Object doesn’t support this property or method
Debugging JavaScript in IE is like a visit to a Sphinx. The error codes are both cryptic and generic, i.e. “Object doesn’t support this property or method.”
By the sound of it this error code will show in many, many situations, but if it helps someone, here’s what caused it in my script: I had an object in the JavaScript and an object in the DOM with the same id. When I tried to manipulate the DOM object it couldn’t do it because that object had be overwritten by the JS object.
Inside the JavaScript I was storing some data for user interaction in an array object. In the HTML I had a DIV with an id equal to the JS array name. The array organized info for the mouse events tied to the DOM element – it made sense to give them identical names.
The solution? Easy enough: limit the scope of the JS variable or re-name one of them.
No Responses
Add your response
Respond to “Object doesn’t support this property or method”