错误:“参数无效",“代码0";在jQuery中的IE8上 [英] Error : "Invalid argument","Code 0" on IE8 in Jquery

查看:237
本文介绍了错误:“参数无效",“代码0";在jQuery中的IE8上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用Jquery.在Firefox上一切正常,但是在IE上,我收到错误消息,提示无效参数",代码0".我发现那行

I'm using Jquery in my project. Everything works good on Firefox, but on IE, I get error saying "Invalid argument","Code 0". I found that the line

$(thisObj).css({'border':'1px dotted transparent;'});

引起问题.

还有其他设置CSS的方法吗?

Is there any other way to set the css ?

此外,在同一项目中,我正在使用styleSheet对象.我已经完成了该功能,并且可以在Firefox上运行.现在,当我在IE上进行测试时,我需要更改一些属性名称以使其正常运行.使其成为IE的最佳方法是什么.我需要重写IE的功能吗?

Also, in the same project, I'm using styleSheet object. I have completed the functionality and it works on Firefox. Now, While I tested on IE, I needed to change some property names to make it working. What can be the best way to make it working for IE also. Do I need to rewrite the functions for IE ?

谢谢.

推荐答案

使用设置调用 .css() 不应该像在普通CSS中那样在值上包含尾随分号.

When using a setting call to .css() you shouldn't include the trailing semi colon on the value, as you would in a normal bit of CSS.

$(thisObj).css({'border':'1px dotted transparent;'});
                                                |
                                      //remove this semi-colon

$(thisObj).css({'border':'1px dotted transparent'});

我刚刚在这里的工作IE7机器上对此进行了快速测试,并且在任何具有这种性质的.css()调用中添加分号都会立即将其打断,并显示您所引用的错误消息.

I've just quickly tested this on my work IE7 machine here, and adding a semi-colon to any .css() call of this nature instantly breaks it with the error message you are quoting.

这篇关于错误:“参数无效",“代码0";在jQuery中的IE8上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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