target blank with jquery and prototype
To be xhtml strict compliant there can't be the target attribute in an anchor tag. Below is a way around it with prototype and jquery.
jQuery
Prototype
All links that you want to open in a blank window now need to have rel="external" set in the anchor link.
jQuery
$(function(){ $('a[@rel$='external']').click(function(){ this.target = "_blank"; }); });
Prototype
Event.observe(window, 'load', function() { $$('a[rel="external"]').each(function(link){ if(link.readAttribute('href') != '' && link.readAttribute('href') != '#'){ link.writeAttribute('target','_blank'); } }); });
All links that you want to open in a blank window now need to have rel="external" set in the anchor link.
<a rel="external" href="http://google.com">Google Rocks.</a>