View Single Post
  #1  
Old 06-21-2009, 09:46 PM
shubeydo shubeydo is offline
Registered User
Pro Plus Member
 
Join Date: Mar 2009
Posts: 27
Default IE8 JavaScript Error

Can someone please tell me why I continually get this JavaScript error with IE8. The page loads correctly but it always shows this error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Timestamp: Mon, 22 Jun 2009 02:18:10 UTC


Message: 'document.getElementById(...)' is null or not an object
Line: 52
Char: 2
Code: 0
URI: http://thegreatmonkey.com/


Here is the code from my site:

Code:
-->
</style>
 
<script type="text/javascript"><![CDATA[//><!--
sfHover = function() {
	if (!document.getElementsByTagName) return false;
	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"), "");
		}
	}
 
}