IE7 中的无效参数:jQuery 和前置

发布于 2024-09-19 16:39:13 字数 438 浏览 13 评论 0原文

当 prepend 方法尝试执行时,下面的代码会呈现无效参数错误。

// close button
closers = overlay.find(conf.close || ".close");

if (!closers.length && !conf.close) {
    closers = $('<div class="close"></div>');
    overlay.prepend(closers);
}

这是 jquery.overlay.js 的一部分,并且该错误仅发生在 IE7 中。在 IE8、FireFox 和 Chrome 中运行良好。我已使用警报来验证 Closers 和 Overlay 是否都是有效对象。以前有人遇到过同样的错误吗?关于 IE7 中的故障排除有什么想法吗?

任何想法都将不胜感激。

The below code renders an invalid argument error when the the prepend method tries to execute

// close button
closers = overlay.find(conf.close || ".close");

if (!closers.length && !conf.close) {
    closers = $('<div class="close"></div>');
    overlay.prepend(closers);
}

This is part of the jquery.overlay.js and the error is only happening in IE7. Works fine in IE8, FireFox and Chrome. I've used alerts to verify that closers and overlay are both valid objects. Has anyone encountered this same error before? Any ideas on troubleshooting within IE7?

Any ideas are greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

四叶草在未来唯美盛开 2024-09-26 16:39:13

尝试使用字符串而不是 jQuery 对象:

closers = '<div class="close"></div>';
overlay.prepend(closers);
closers = $(closers);

我不知道它是否有效或为什么它应该有效:-)
但尝试一下并告诉我是否有效......

try a string instead of a jQuery object:

closers = '<div class="close"></div>';
overlay.prepend(closers);
closers = $(closers);

I don't know if it works or why it should work :-)
But try it and tell me if it worked...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文