IE8上的jQuery,错误:对象不支持此属性或方法 [英] jQuery on IE8, error: Object doesn't support this property or method

查看:205
本文介绍了IE8上的jQuery,错误:对象不支持此属性或方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有正在构建的WordPress主题的jQuery.我已经放弃了对IE6和IE7(布局的地狱)的测试,现在我正在使用IE8对其进行测试.每次我单击prettyPhoto链接或jQuery循环链接时,JS都会发出此错误,并且无法调出灯箱或移动滑块.像往常一样,他在所有其他浏览器上都能正常工作.

I have jQuery for a WordPress theme I'm building. I've given up for now on testing IE6 and IE7 (layouting hell), and now I'm testing it using IE8. Every time I click on a prettyPhoto link OR a jQuery cycle link, JS gives out this error and fails to bring up the lightbox or move the slider. As usual his works fine in all the other browsers.

该网站位于 http://themes.thefirm.gambit.ph

在IE8中以及单击标题区域的向左或向右箭头时,您会看到错误.

You can see the error when in IE8, and when you click on the left or right arrows of the header area.

对象不支持此属性或方法

Object doesn't support this property or method

有人可以帮忙吗?还有其他人遇到吗?我对此感到很困惑,无法从Google找到任何东西.

Can someone please help? Has anyone else encounter this? I'm quite stumped at this and I can't find anything from Google.

更新:我已经上传了网站并更新了此问题

Update: I've uploaded the site and updated this question

推荐答案

jQuery(最小版本)中引起错误的行是:

The line in jQuery (minified version) that's causing the error is:

第140行:var C = Bb.exec(u)

somehwere in line 140: var C=Bb.exec(u)

解决方案是将此行更改为:

The solution is to change this line to:

var C = Bb.exec(u.toString())

var C=Bb.exec(u.toString())

@kirilloid是正确的,因为正则表达式会抛出错误,尤其是当匹配的值是数字时. 例如动画css属性,例如不透明度,顶部,左侧等.将其转换为字符串可解决此问题.现在IE不再出现任何错误.

@kirilloid is correct in that Regexp is throwing the error especially when the value being matched is numeric. e.g. animating css properties such as opacity, top, left, etc. Converting it to string fixes the problem. Now IE is not getting any more errors.

自从我编辑jQuery库文件以来,我不太喜欢此修复程序,但是我想我必须解决这个问题.所做的更改不必对正常功能产生任何不良影响.

I don't like this fix very much since I edited the jQuery library file, but I guess I'll have to make do with it. The change doesn't have to have any bad side effects to normal functionality.

这篇关于IE8上的jQuery,错误:对象不支持此属性或方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆