P
Pim Sohful
Hi,
I have a website full of external links. On the site I have a checkbox where
users can indicate that they want to have the link opened in a new window or
in the same window.
It is rather basic code:
var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; i++)
{ base = anchors.href;
if(base.substr(4,3)=="://") // is it external link?
{ if(flag=="Y")
anchors.target="_blank";
else
anchors.target="_self";
}
}
Unfortunately one of my users is reporting that he gets links that do not
work. I strongly suspect that it is some security program that disables the
links when they are touched by my script.. However, I cannot reproduce the
environment of this man (Safari + Norton), as I don't have neither.
Does anyone know about this kind of problem and have a suggestion how to
solve this?
Thanks,
Pim
I have a website full of external links. On the site I have a checkbox where
users can indicate that they want to have the link opened in a new window or
in the same window.
It is rather basic code:
var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; i++)
{ base = anchors.href;
if(base.substr(4,3)=="://") // is it external link?
{ if(flag=="Y")
anchors.target="_blank";
else
anchors.target="_self";
}
}
Unfortunately one of my users is reporting that he gets links that do not
work. I strongly suspect that it is some security program that disables the
links when they are touched by my script.. However, I cannot reproduce the
environment of this man (Safari + Norton), as I don't have neither.
Does anyone know about this kind of problem and have a suggestion how to
solve this?
Thanks,
Pim