Consider the following Javascript:
var anchors = document.getElementsByTagName('a');
for(var i=0; i < anchors.length; i++)
{
alert(a.pathname);
}
When I run this on a page that contains links in the format "http://foo.com/bar", in IE8 I get back a string that looks like "bar". In Safari, Chrome, Firefox, I get back something like "/bar" (note the leading forward slash).
Is IE at fault here, what's the deal?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…