Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can anybody tell me exactly what the Object doesn't support this property or method means in IE for JS?

while surfing through the web and through stackoverflow.com i found many posts in forums, etc. where this message occures in IE but not in the other browsers. the thing is, the resolutions vary widely and it's not clear for me what's the best way to avoid this problem.

So my question is, if anybody knows exactly, specificly what this message Object doesn't support this property or method

means, causes, says ,...

thanks for help. helle

like image 861
helle Avatar asked Jun 03 '10 17:06

helle


1 Answers

Quite often, the real problem indicated by that error is that something your code expects not to be null is in fact null.

var thing = document.getElementById('thing');
var x = thing.getAttribute('x');

If there's no "thing" element in the page, the variable will be null and you'll get the error.

In general it's a good idea not to think too hard about what IE is trying to tell you with its error messages. Just imagine that the browser is making a dull grunting sound, like a badly-trained animal.

like image 99
Pointy Avatar answered Oct 13 '22 01:10

Pointy