phipm1
08-19-2011, 02:13 PM
I have javascript code puting url title on external links but it is also putting them on my internal and email links as well.
I can't figure out how to not have url title on internal and email links.
I've attached my code.
extlinkTitle.js
function extlinkTitle() {
var mat=[];
var anc=document.getElementsByTagName('a');
for(c=0;c<anc.length;c++){
mat[c]=anc[c].href.match(/quicklinks*/g);
if(mat[c]==null){
anc[c].title='you are leaving';
}
}
}
window.addEventListener?
window.addEventListener('load',extlinkTitle,false):
window.attachEvent('onload',extlinkTitle);
I can't figure out how to not have url title on internal and email links.
I've attached my code.
extlinkTitle.js
function extlinkTitle() {
var mat=[];
var anc=document.getElementsByTagName('a');
for(c=0;c<anc.length;c++){
mat[c]=anc[c].href.match(/quicklinks*/g);
if(mat[c]==null){
anc[c].title='you are leaving';
}
}
}
window.addEventListener?
window.addEventListener('load',extlinkTitle,false):
window.attachEvent('onload',extlinkTitle);