我为正在构建的 WordPress 主题安装了 jQuery。我暂时放弃了测试 IE6 和 IE7(布局 hell ),现在我正在使用 IE8 对其进行测试。每次我单击 prettyPhoto 链接或 jQuery 循环链接时,JS 都会发出此错误并且无法调出灯箱或移动 slider 。像往常一样,他在所有其他浏览器中工作正常。
网站在http://themes.thefirm.gambit.ph
您可以在 IE8 中以及单击标题区域的向左或向右箭头时看到该错误。
Object doesn't support this property or method
有人可以帮忙吗?还有其他人遇到过这个吗?我对此感到很困惑,我无法从 Google 中找到任何内容。
Update: I've uploaded the site and updated this question
最佳答案
导致错误的 jQuery(缩小版)行是:
somehwere in line 140: var C=Bb.exec(u)
解决方案是将此行更改为:
var C=Bb.exec(u.toString())
@kirilloid 是正确的,因为 Regexp 会抛出错误,尤其是当匹配的值是数字时。 例如动画 css 属性,如不透明度、顶部、左侧等。 将其转换为字符串可以解决问题。现在 IE 不再收到任何错误。
自从我编辑了 jQuery 库文件后,我不太喜欢这个修复程序,但我想我将不得不使用它。更改不一定会对正常功能产生任何不良影响。
关于javascript - IE8 上的 jQuery,错误 : Object doesn't support this property or method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4987842/