jQuery ajaxComplete() 方法

jQuery 教程 · 2019-03-28 14:57:27

实例

当 AJAX 请求正在进行时显示 "loading" 的指示:

$(document).ajaxStart(function(){ $("#wait").css("display","block"); }); $(document).ajaxComplete(function(){ $("#wait").css("display","none"); });

定义和用法

ajaxComplete() 方法规定 AJAX 请求完成时运行的函数。

注意:自 jQuery 版本 1.8 起,该方法只被附加到文档。

不像 ajaxSuccess(),通过 ajaxComplete() 方法规定的函数将在请求完成时运行,即使请求并未成功。

语法

$(document).ajaxComplete(function(event,xhr,options))

参数 描述
function(event,xhr,options) 必需。规定当请求完成时运行的函数。
额外的参数:
  • event - 包含 event 对象
  • xhr - 包含 XMLHttpRequest 对象
  • options - 包含 AJAX 请求中使用的选项

点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html

查看所有标签

Beginning iPhone and iPad Web Apps

Beginning iPhone and iPad Web Apps

Chris Apers、Daniel Paterson / Apress / 2010-12-15 / USD 39.99

It seems that everyone and her sister has developed an iPhone App—everyone except you, the hard-working web professional. And now with the introduction of the iPad, you may even feel farther behind. B......一起来看看 《Beginning iPhone and iPad Web Apps》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试