jQuery-预期在IE和$(document).ready(function(){})上使用的对象; [英] jQuery - Object Expected on IE and $(document).ready(function() {});

查看:160
本文介绍了jQuery-预期在IE和$(document).ready(function(){})上使用的对象;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面([链接已删除])在FireFox和Chrome中完全可以正常运行,但是由于某些原因,即使不是所有版本的IE,我也都在大多数情况下收到期望对象"错误.

I have a page ([LINK REMOVED]) that works completely well in FireFox and Chrome, but for some reason I am getting an "Object Expected" error in most, if not all versions of IE.

该错误发生在行上

$(document).ready(function() {
    //^ Error occurs here ^
    ...
}

我正在使用 jQuery工具,该工具实现了jQuery 1.4.2,以及一些其他的东西.

I am using jQuery Tools, which implements jQuery 1.4.2, as well as some additional stuff.

我已经阅读了一些.我试图将ready函数放在代码的末尾,就在</body>标记之前-此外,我试图实现一个计时器以在执行前让IE加载,而我不能动摇此错误./p>

I've done some reading around. I've tried to put the ready function at the end of the code, right before the </body> tag - in addition, I've tried implementing a timer to let IE load before executing, and I can not shake this error.

推荐答案

这是一个可能导致IE在其他浏览器无法阻止的地方阻塞的问题:

Here's one problem that can cause IE to choke where other browsers may not:

$('#' + resultDivName).animate({
  height: '300px', // <=== TRAILING COMMA
}, 500, function() {
  // Animation complete.
});  

然后,在您的qtip呼叫中,您拥有:

Then, in your qtip call, you have:

target: 'popPart_WM300BP'

我相信 target需要一个jQuery DOM对象,不是字符串. DebugBar将此行指出是预期对象"的原因.

I believe target takes a jQuery DOM object, not a string. DebugBar points to this line as the cause of "object expected".

最后,看起来这个版本的jQuery Tools包含jQuery 1.4.2.也许1.4.3或1.4.4值得一试.

Finally, it looks like this version of jQuery Tools includes jQuery 1.4.2. Perhaps 1.4.3 or 1.4.4 would be worth a try.

这篇关于jQuery-预期在IE和$(document).ready(function(){})上使用的对象;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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