Created
March 1, 2012 08:07
-
-
Save kristof/1948207 to your computer and use it in GitHub Desktop.
Blank target for external link
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[href^='http:']:not([href*='" + window.location.host + "'][target='_blank'])").on('click', function(){ | |
$(this).attr('target','_blank'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment