ajax ajaxSuccess() method
Translation results:
Ajax
English [ˈeɪˌdʒæks] American [ˈeˌdʒæks]
n. The full name is "Asynchronous JavaScript and XML" (asynchronous JavaScript and XML); refers to a A web development technology for creating interactive web applications. ;Ajax copper-tin-lead bearing alloy, Yajis explosive
success
UK[səkˈses] 美[səkˈsɛs]
n.Success , achievement; good grades, good results; successful people (or things)
ajax ajaxSuccess() methodsyntax
Function: ajaxSuccess() method executes the function when the AJAX request is successful. It is an Ajax event.
Syntax: .ajaxSuccess(function(event,xhr,options))
Description: XMLHttpRequest object and settings are passed as parameters to the callback function. Whenever an Ajax request completes successfully, jQuery fires the ajaxSuccess event. At this point, any functions registered by the .ajaxSuccess() method will be executed.
Parameters:
Parameter | Description |
function (event,xhr,options) | Required. Specifies a function to run when the request succeeds. Additional parameters: event - contains the event object xhr - contains the XMLHttpRequest object options - contains the options used in the AJAX request. |
ajax ajaxSuccess() methodexample
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("div").ajaxSuccess(function(){ alert("AJAX 请求已成功完成"); }); $("button").click(function(){ alert("改变文本成功"); }); }); </script> </head> <body> <div id="txt"><h2>通过 AJAX 改变文本</h2></div> <button>改变内容</button> </body> </html>
Click the "Run instance" button to view the online instance