我该如何去获得阿贾克斯队列插件jQuery的1.3工作? [英] How do I go about getting the Ajax Queue plugin working in jQuery 1.3?

查看:116
本文介绍了我该如何去获得阿贾克斯队列插件jQuery的1.3工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,能同时将多个Ajax请求。原本我是运行到比赛状态,直到我发现了的jQuery的Ajax队列插件,它使用jQuery的伟大工程1.2,但无法使用jQuery 1.3。实际上有两个不同版本的插件;我目前正在使用这个这是与第一只是增加了更多的功能。

I have an app that sends multiple Ajax requests simultaneously. I was originally running into race conditions until I discovered the jQuery Ajax Queue plugin, which works great with jQuery 1.2, but fails with jQuery 1.3. There are actually two different versions of the plugin; I am currently using this one which is the same as the first but just adds a bit more functionality.

总之,我使用萤火虫在Firefox 3.0.10,当我运行我的code我没有收到任何明确的错误,只是再也没有回过电话。

Anyway, I am using Firebug on Firefox 3.0.10 and when I run my code I don't receive any explicit errors, the call is just never returned.

我能明显继续使用1.2版,但真的想了解为什么这个插件失败,并在最新的版本和我能做些什么来得到它的工作。

I could obviously continue using v1.2 but would really like to learn why this plugin fails with the latest release and what I can do to get it working.

在此先感谢。

推荐答案

您应该能够使用jQuery的内置队列支持,如果你愿意做一些跑腿的。

You should be able to use jQuery's built-in queue support if you're willing to do a bit of legwork.

// First Ajax request
$(document).queue("ajaxRequests", function() {
  $.ajax({
    // Stuff
    success: function() {
      $(document).dequeue("myName");
    });
  });
});

// Second Ajax request
$(document).queue("ajaxRequests", function() {
  $.ajax({
    // Stuff
    success: function() {
      $(document).dequeue("myName");
    });
  });
});

// Trigger the queue
$(document).dequeue("ajaxRequests");

当然,这将是pretty的容易将保鲜膜,在一个插件。

Of course, it would be pretty easy to wrap that in a plugin.

这篇关于我该如何去获得阿贾克斯队列插件jQuery的1.3工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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