Friday, November 18, 2011

Automatic external link open in New Window

[javascript]
$('a').each(function() {
var a = new RegExp('/' + [removed].host + '/');
if(!a.test(this.href)) {
$(this).click(function(event) {
event.preventDefault();
event.stopPropagation();
window.open(this.href, '_blank');
});
}
});
[/javascript]

0 comments:

Post a Comment