/ Published in: JavaScript
Expand |
Embed | Plain Text
$(document).ready(function() { externalLink(); }); function externalLink() { $("a[@href^=http]").each( function(){ if(this.href.indexOf(location.hostname) == -1) { $(this).attr('target', '_blank'); } } ) };
You need to login to post a comment.
