Created
November 18, 2011 03:12
-
-
Save timnovinger/1375476 to your computer and use it in GitHub Desktop.
ColorJar: Force all external links to open in a new page
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
// Switch out "DOMAIN" to be whatever the site domain is. | |
// | |
// ie. "colorjar" for http://colorjar.com | |
$.map($('a'), function(link){ | |
if (link.href.search(/.DOMAIN./) === -1){ | |
$(link).attr('target', '_blank'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment