Yes, I had a rather old script in place for this, but some Stackoverflowing brought me to a new much more elegant solution:
$('a').each(function() {
if(this.host !== window.location.host) {
$(this).attr('target', '_blank');
}
});
Yes, I had a rather old script in place for this, but some Stackoverflowing brought me to a new much more elegant solution:
$('a').each(function() {
if(this.host !== window.location.host) {
$(this).attr('target', '_blank');
}
});