IE Javascript error “Object doesn't support this property or method” within jQuery

与世无争的帅哥 提交于 2019-12-01 16:51:36

As it turns out, I managed to figure it out by myself after several painful hours. It appears the Sizzle selector engine breaks in this unexpected way (and only in Internet Explorer), if you have defined Object.prototype.previousObject elsewhere.

Removing that declaration, or renaming previousObject to something else fixes the problem.

The funny thing is, I even put that code there myself (the Object.prototype.previousObject = [the function in my question]), but I did not recognize the code.

Well, that's another day full of development potential wasted.

Malcolm

I have discovered the same behaviour occurs if you attempt to add a method called "inherited" to the Object.prototype, ie Object.prototype.inherited = <some func>

It affects IE6, 7 & 8 but seems to be fixed in IE9 (beta)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!