michaeldank
9/11/2017 - 12:31 AM

Adds target="_blank" FOR EXTERNAL LINKS on 'a' tags - works on graphical buttons if you made them a tags rather than divs eg. <a class="bas

Adds target="_blank" FOR EXTERNAL LINKS on 'a' tags - works on graphical buttons if you made them a tags rather than divs eg.

*** BUTTON HEADING ***
<script>
$(document).ready(function(){
  $.expr[':'].external = function(obj){
    return !obj.href.match(/^mailto\:/)
           && (obj.hostname != location.hostname)
           && !obj.href.match(/^javascript\:/)
           && !obj.href.match(/^$/)
};

$('a:external').attr('target', '_blank');
});
</script>