Created
September 13, 2010 04:12
-
-
Save 0xnbk/576791 to your computer and use it in GitHub Desktop.
Target blank links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[@rel$='external']').click(function(){ | |
this.target = "_blank"; | |
}); | |
/* | |
Usage: | |
<a href="http://www.lepinskidesign.com.br/" rel="external">lepinskidesign.com.br</a> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Target blank links
Do you use the target=blank attribute on links? If yes, you might know that XHTML 1.0 Strict don’t allow it. A good solution to this problem should be using JQuery to make links opening in new windows: