bratsun
11/17/2014 - 8:10 AM

Open all external links in new window

Open all external links in new window

$('a[href*="http"]').each(function() {
  var a = new RegExp('/' + window.location.host + '/');
  if(!a.test(this.href)) {
    $(this).attr('target','_blank');
  }
});