Created
March 22, 2012 15:16
-
-
Save adamstac/2158949 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$(document).ready(function() { | |
// Open external links in a new window | |
hostname = window.location.hostname | |
$("a[href^=http]") | |
.not("a[href*='" + hostname + "']") | |
.addClass('link external') | |
.attr('target', '_blank'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment