I am using the last method you proposed. I add rel=”external” or something similar and then use jQuery to iterate through all links and assign them a click handler:
$(document).ready(function() {
$('a[rel*=external]').click(function(){
window.open($(this).attr('href'));
return false;
});
});
I find this the best method because:
- it is very clear semantically: you have a link to an external resource
- it is standards-compliant
- it degrades gracefully (you have a very simple link with regular
hrefattribute) - it still allows user to middle-click the link and open it in new tab if they wish