ajax ajaxStop() 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, Ajax explosive

UK[stɒp] 美[stɑ:p]

vi .Stop; interrupt; stay; (make) stop working

vt.Block; block; obstruct; stop payment

n.stop;(organ's) sound stop;stop;( pipe organ) pipe

ajax ajaxStop() methodsyntax

Function: The ajaxStop() method executes the function at the end of the AJAX request. It is an Ajax event.

Syntax: .ajaxStop(function())

Description: No matter when the Ajax request is completed, jQuery will check whether There are other Ajax requests. If it doesn't exist, jQuery fires the ajaxStop event. At this point, any functions registered by the .ajaxStop() method will be executed.

Parameters:

Parameter Description
function ()Specifies the function to be run when the AJAX request is completed.

ajax ajaxStop() 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").ajaxStop(function(){
    alert("所有 AJAX 请求已完成");
  });
  $("button").click(function(){
  $("h2").text("改变文本成功");
  });
});
</script>
</head>

<body>

<div id="txt"><h2>通过 AJAX 改变文本</h2></div>
<button>改变内容</button>

</body>
</html>
Run instance »

Click the "Run instance" button to view the online instance

Home

Videos

Q&A