有什么区别:1。(ajaxStart和ajaxSend)和2(ajaxStop和ajaxComplete)? [英] What's the difference between : 1. (ajaxStart and ajaxSend) and 2. (ajaxStop and ajaxComplete)?

查看:229
本文介绍了有什么区别:1。(ajaxStart和ajaxSend)和2(ajaxStop和ajaxComplete)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上是这样的问题(括号中是很重要的)

Basically that's the question (parentheses are important)

推荐答案

.ajaxStart() .ajaxStop() 所有的请求的一起 ajaxStart 火灾时的第一的并发请求将启动, ajaxStop 火那么的最后的,如果同时一批完成的。

.ajaxStart() and .ajaxStop() are for all requests together, ajaxStart fires when the first simultaneous request starts, ajaxStop fires then the last of that simultaneous batch finishes.

所以说,你让3请求全部一次, ajaxStart()火灾时,第一次启动时, ajaxStop()火灾时,最后一个(他们并不一定完成按顺序)回来。

So say you're making 3 requests all at once, ajaxStart() fires when the first starts, ajaxStop() fires when the last one (they don't necessarily finish in order) comes back.

这些事件的的得到任何的参数,因为他们是为一批请求:

These events don't get any arguments because they're for a batch of requests:

.ajaxStart( handler() )
.ajaxStop( handler() )


.ajaxSend() 和的 .ajaxComplete() 火一次的每个请求作为他们发送/完整。这就是为什么这些处理程序传递的参数和全球/批的是不是:


.ajaxSend() and .ajaxComplete() fire once per request as they send/complete. This is why these handlers are passed arguments and the global/batch ones are not:

.ajaxSend( handler(event, XMLHttpRequest, ajaxOptions) )
.ajaxComplete( handler(event, XMLHttpRequest, ajaxOptions) )

对于单个文件来源,全局AJAX事件的<一个部分HREF =htt​​p://api.jquery.com/>的API 是你追求的是什么。

For a single documentation source, the Global Ajax Events section of the API is what you're after.

这篇关于有什么区别:1。(ajaxStart和ajaxSend)和2(ajaxStop和ajaxComplete)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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