User:Testwiki22/common.js

function fixExternalLinks { var nodes = document.querySelectorAll('.wikiexternallink a'); for(var i=0; i< nodes.length; i++){ var link = nodes[i]; if (link.hasAttribute('target') == false) { link.setAttribute('target', '_blank'); }			 }			}		document.addEventListener("DOMContentLoaded", fixExternalLinks); require(['jquery'], function($) {		 jQuery(document.links).filter(function { return this.hostname != window.location.hostname; }).attr('target', '_blank');		});