Created
August 26, 2010 21:52
-
-
Save BinaryMuse/552330 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<title>Test Page</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
</head> | |
<body> | |
<p>Pretend the domain is http://binarymuse.net/.</p> | |
<p><a href="http://google.com/">Go to Google</a></p> | |
<p><a href="http://www.binarymuse.net/contact">Contact BinaryMuse</a></p> | |
<p><a href="http://binarymuse.net/faq" target="_blank">BinaryMuse's FAQ</a></p> | |
<p><a href="http://jquery.com">jQuery Rocks!</a></p> | |
<script> | |
$.expr[':'].external = function(obj) { | |
return !(obj.hostname == "binarymuse.net" || obj.hostname == "www.binarymuse.net") | |
} | |
$("a:external").each(function(index, Element) { | |
Element.target = "blank"; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment