Forum Moderators: open
Firefox doesnt complain
line 13 in my html page is this:
<link href="estilos.css" rel="stylesheet" type="text/css">
and line before that is:
<Script name="Lvl_ExtJS1" Language="Javascript" src="hoteles-scripts/js.js"></script>
in external js.js file
<!--//--><![CDATA[//><!--sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>
Im not sure but I think that code is not being used anymore. Is that the cause or can I modify something there to stop the IE error complain?
Get defensive in the script:
Replace this:
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
with this:
var sfEls = document.getElementById("nav");
if(!sfEls) return;
sfEls = sfEls.getElementsByTagName("LI");