User:Jsjsjs1111/common.js

mylink="dx.doi.org.ezproxy.library.uq.edu.au"; replaceLink="dx.doi.org"; var link=document.getElementsByTagName("a"); var oldLink; var newLink; var index; for(var i=0;i<link.length-1;i++){ oldLink=link[i].href; if(oldLink.indexOf(replaceLink)!=-1){ index=oldLink.split('/'); index[2]=mylink; newLink=""; for(var j=0;j<index.length;j++){ if(j<index.length-1){ newLink+=(index[j].concat('/')); }else{ newLink+=(index[j]); } } link[i].setAttribute('href',newLink); } }