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

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

问题描述

我有一个WordPress主题的jQuery我正在建设。我已经放弃了现在测试IE6和IE7(布局地狱),现在我使用IE8测试它。每次我点击prettyPhoto链接或一个jQuery循环链接,JS给出了这个错误,并无法启动lightbox或移动滑块。像往常一样,他的作品在所有其他浏览器中都很好。



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



在IE8中可以看到错误,当您点击左侧或




$ b

有人可以帮忙吗?有没有人遇到这个?我很抱歉,我从Google找不到任何东西。


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



解决方案

在jQuery(缩小版本)中导致错误的是:


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


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



< blockquote>

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


@kirilloid Regexp抛出的错误,特别是当匹配的值是数字。 例如。动画css属性,例如不透明度,顶部,左侧等。将其转换为字符串可以解决问题。现在IE没有得到任何更多的错误。



我不喜欢这个解决方法非常多,因为我编辑jQuery库文件,但我想我必须做它。更改不必对正常功能有任何不良影响。


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.

The site is in http://themes.thefirm.gambit.ph

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

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

解决方案

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

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

The solution is to change this line to:

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

@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.

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.

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

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