jQuery 插件“lazy”无法加载两个 jQuery 插件,每个插件中都有 $.getJSON 调用:仅在 Firefox 中递归过多

发布于 2024-08-23 18:44:29 字数 481 浏览 6 评论 0原文

插件:jQuerylazy()

我在这里问是因为项目页面本身似乎已经死了。

哪些步骤会重现该问题? 1. 嵌入两个都使用 $.getJSON 函数的 jQuery 插件 导致 Firefox 中出现“太多递归错误”。如果相同的脚本 用惰性引用它工作得很好。问题仅在 Firefox 中存在。 2. 请参阅此处的示例:

http://www.marctv.de/lazybug/lazy.htm< /a>

预期输出是什么?你看到了什么? 预期:两个 getJSON 调用都应该可以正常工作。但由于懒惰,我得到了“太 much recursion”错误。

您使用的产品版本是什么?在什么操作系统上? 最新的懒人版本。所有 jquery 版本都可以重现错误。

我们能做什么?有什么想法吗?

Plugin: jQuery lazy()

I ask here because the project page itself seems to be dead.

What steps will reproduce the problem?
1. embed two jQuery-Plugins that are both using the $.getJSON function
results in a "too much recursion error" in firefox. If the same scripts are
referenced with lazy it works fine. Problem only persits in firefox.
2. See example here:

http://www.marctv.de/lazybug/lazy.htm

What is the expected output? What do you see instead?
Expected: both getJSON calls should work ok. But with lazy I get a "too
much recursion" error.

What version of the product are you using? On what operating system?
latest lazy version. Error can be reproduced with all jquery versions.

What can we do? Any ideas?

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

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

发布评论

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

评论(1

满地尘埃落定 2024-08-30 18:44:29

我也有同样的问题。我发现递归发生在 proxy() 函数的第 111 行。我通过重新下载插件解决了这个问题。您可以尝试用以下方法修补您的代码:

if( $.lazy.archive[src].status === 'loaded' ) {

  $.lazy.archive[src].status = 'unloaded';
  $.each(this,function(){
    $(this)[name].apply(self,arg);
  });

}

I had the same problem. I found that the recursion happens on line 111 in proxy() function. I solved this by redownloading plugin. You can try patching your code with this:

if( $.lazy.archive[src].status === 'loaded' ) {

  $.lazy.archive[src].status = 'unloaded';
  $.each(this,function(){
    $(this)[name].apply(self,arg);
  });

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