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

前端 未结 2 619
清酒与你
清酒与你 2021-01-18 07:50

For some reason, I am getting the following Javascript error in Internet Explorer 8 on line 3156 of jquery.js (version 1.4.3, non-compressed version): Object doesn\'t

相关标签:
2条回答
  • 2021-01-18 08:05

    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.

    0 讨论(0)
  • 2021-01-18 08:09

    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)

    0 讨论(0)
提交回复
热议问题