/ Published in: JavaScript
Automatically use jQuery to Open External Links in New Window (checking domain first).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// open external links in new window (checking domain first) jQuery("a[href^='http']:not([href*='" + document.domain + "'])").each(function () { jQuery(this).attr("target", "_blank"); });