Hello,
Yesterday I spent a lot of time to find why my javascript script was
not working on Safari. I finaly found a solution but not the reason.
And I'd like to know if someone could tell me if what seems to be an
esotheric bug is actualy not!
Here is the problematic part:
-------------------------------
Index.prototype.getHeaderNodes = function(){
var nodes = this.node.childNodes;
var headerNodes = [];
// for(var i in nodes){ <-- Bad with Safari (v. 2.0.4)
for(var i = 0; i < nodes.length; i++){
if(this.isGoodNode(nodes[i])) headerNodes.push(nodes[i]);
}
return headerNodes;
}
-------------------------------
If I replace the "for(var i = 0; ..." for "for(var i in nodes){" it
simply not entering the for. As if nodes was empty.
I've got many "for(var i in nodes)" in my script and all of them are
working fine.
I did try to change "nodes" for "foo" to check if the variable name was
causing a problem but it didn't work either.
Testing with recent version of Firefox, IE, Mozilla are all working
fine with the line causing problem to Safari.
Thanks for you time.
Yannick