正在进行的jQuery Ajax请求 [英] Ajax request in progress jQuery
本文介绍了正在进行的jQuery Ajax请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种方法来检查,如果有正在进行的Ajax请求? 是这样的:
如果($ .ajax.inProgress){做到这一点; }其他{做到这一点; }
解决方案
您应该基本上是对脚本设置为假的顶部设置一个变量
和AJAX同修将其设置为真
和成功
处理程序将其设置为假
再为 <一个href="http://stackoverflow.com/questions/2008507/jquery-ajax-request-wait-for-latest-request-to-finish">described这里
Is there a way to check if there's ajax request in progress? Something like:
if ( $.ajax.inProgress ){ do this; } else { do that; }
解决方案
You should basically set a variable on top of script set to false
and on ajax initiate set it to true
and in the success
handler set it to false
again as described here.
这篇关于正在进行的jQuery Ajax请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文