I have come across a couple of clients that refuse to have external links opening in the same window.
I meet my clients halfway and say that they need to add a class to their external links that way we can apply a little jQuery love and get them to open in a new window.
How I deal with this situation, is quite a well used ‘hack’ with a little twist, let me know what you think…
I fully understand that this is really not the way to do it and is really cheating the validation, but what are you meant to do instead?
so for example
external link before, which does not validate
<a href="http://www.google.com" target="_blank" rel="nofollow">Google</a>
external link after, which does validate in a hacky kind of way….
<a class="external" href="http://www.google.com" rel="nofollow">Google</a>
and the magic bit of jQuery
$('a[class*="external"]').live('click',function(){ this.target='_blank'; });
and voila! We have the external links opening in a new window the hacky way





Recent discussions