Tag: rel=”external”

JQuery: Open external links in new window

Finally got round to writing a small bit of code to automatically force anchor links to open in new windows if they are for different domains: $(document).ready(function() { var myDomain = ["www.ajgraham.com", "testing.ajgraham.com", "lifestream.ajgraham.com"]; //do NOT include the http:// pls! $(“a[href^='http://']“).each(function() { var slicedHref = $(this).attr(‘href’).slice(7); var slashPosition = slicedHref.indexOf(“/”); [...]