hi respected friends i have problem, while loading of page in Internet Explorer i have software related website http://alisoft7.blogspot.com when i opened page. i have seen this error on status bar. i attached the picture kindly see this error and help me thanks in advance
I didn't get that error in IE, and firefox i only had one that related to google i think... But wow that is a lot of code for one page.
The error shows on Line 1517 under chart 15 that your site sfEls1 is undefined. So kindly check that code properly and solve the error.
thanks for your reply this is the code can u remove this error? because i hate javascript . so i could not do my self <script type='text/javascript'><!--//--><![CDATA[//><!-- sfHover = function() { var sfEls = document.getElementById("menu").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls.onmouseover=function() { this.className+=" sfhover"; } sfEls.onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } for (var i=0; i<sfEls1.length; i++) { sfEls1.onmouseover=function() { this.className+=" sfhover1"; } sfEls1.onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover1\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); //--><!]]></script>
You define sfEls: var sfEls = document.getElementById("menu").getElementsByTagName("LI"); Code (markup): but not sfEls1 which is used here: for (var i=0; i<sfEls1.length; i++) { sfEls1[i].onmouseover=function() { this.className+=" sfhover1"; } sfEls1[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover1\\b"), ""); } } Code (markup): but not defined. So you need to either define it to the element that it is supposed to be, or remove the above code.
thanks for the help i removed the code... and now error found, i think, this code doesn't help me in the website thanks
you could do a null check first before you try a "getElementsByTagName" call. eg. var sfEls ; if (document.getElementById("menu")) { sfEls = document.getElementById("menu").getElementsByTagName("LI"); } It's always good practice to do a null check before calling functions on an object.