admin管理员组文章数量:1323731
while surfing through the web and through stackoverflow 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
while surfing through the web and through stackoverflow. 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
Share Improve this question edited Jun 8, 2011 at 1:44 Billy ONeal 107k61 gold badges328 silver badges562 bronze badges asked Jun 3, 2010 at 17:06 hellehelle 11.7k9 gold badges57 silver badges85 bronze badges3 Answers
Reset to default 8Quite 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.
It means the object doesn't support the method you're trying to call.
function Foo() {
};
var something = new Foo();
something.fish(); // Error: because fish is not defined as a method.
well, after an other huge lookup for the causes of the problem (like in the microsoft JS specification ... where no plete table of errors can be found) i e to the same result like @Pointy. for sure @Matt has helped too! IE really grunts around, when something does not work for him. i didn't find any exact spezification of the error so far.
and there is the othere resume:
in many many cases its caused by naming JS Object with same name like DOM-Elements or DOM-Elements IDs, because IE - in some cases - interpretes them as beeing the same. so you kind of overwrite objects from above.
to avoid this, allways use the var [vaiablename] = [value];
syntax to initilize a variable. (the var is absolutly neccessary in IE.
while surfing through forums , i found out it helps in very many cases but is no universel remedy.
regards helle
本文标签:
版权声明:本文标题:javascript - Can anybody tell me exactly what the Object doesn't support this property or method means in IE for JS? - S 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742121764a2421742.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论