/ Published in: JavaScript
Better than previous version. You don't have to mark up your links with 'rel=external'.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jQuery('a[href^=h]').each(function(){ if (this.hostname !== location.hostname) { jQuery(this).attr({ target: "_blank", title: this.href + " (External link, click to open in a new window)" }); } });