Weird Thoughts From Eric's Head

Tags - Categories : All | AJAX | BUSINESS | PERSONAL | PROGRAMMING | BOOK REVIEW

JavaScript Error: "Could not get the cursor property"

I thought I would pull another error to pull from my logs that I found interesting for a Friday post. (For those that do not read my blog, I log my clientside errors to the server, see this.)

The Error

Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
NAME:    Error
DESC:    Could not get the cursor property. Invalid argument.
MSG:     undefined

Well the function that the try catch caught this expection contained the following basic code:

myObject.style.cursor = "pointer";

We all know that IE used hand in earilier versions so I changed my code to do this:

try{
  myObject.style.cursor = "pointer";
}
catch(eOldIEVersion){
  myObject.style.cursor = "hand"; 
}

Since I have added this fix, the IE 5.5 error has not shown up in my logs. I also tested this on my virtual machine running Windows 98 and IE 5.0. The result showed the hand and did not report an error.



Eric Pascarello
Coauthor of Ajax In Action
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for building Dynamic Web Pages


This was useful to me trying to debug a few issues that we're having with 5.5 users and this sorted it, Good Work Fella! thanks for posting


Add a comment

Title
Body
HTML : b, i, blockquote, br, p, pre, a href="", ul, ol, li
Math Quiz 10 + 5 = (Helps stop blog spam)
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).

TrackBack to http://radio.javaranch.com/pascarello/addTrackBack.action?entry=1157728818312