Latest web development tutorials

jQuery ajaxSuccess () method

jQuery AJAX Methods jQuery AJAX Methods

Examples

When the AJAX request is successfully completed, triggering a prompt box:

$(document).ajaxSuccess(function(){
       alert("AJAX 请求完成");
});

try it"

Definition and Usage

ajaxSuccess () method specifies a function to run when an AJAX request completes successfully.

Note: Since jQuery version 1.8 onwards, this method is only attached to the document.


grammar

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

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


Examples

More examples

Use the options parameter
How to use the options parameter to limit the function uses AJAX request specific documents.


jQuery AJAX Methods jQuery AJAX Methods