Home >>jQuery Tutorial >jQuery ajaxStop() Method
jQuery ajaxStop() method in jQuery is used to specifies a function to run when ALL AJAX requests have completed.
Syntax:$(document).ajaxStop(function())
Parameter | Description |
---|---|
function() | It is a Required parameter and is used to specifies the function to run when all AJAX requests have completed |
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(document).ajaxStop(function(){
alert("Completed All AJAX Request");
});
$(".btn1").click(function(){
$(".box1").load("demo_ajax_load.txt");
$(".box1").load("demo_ajax_load.asp");
});
});
</script>
</head>
<body>
<div class="box1"><h2>Change this text</h2></div>
<button class="btn1">Click me to Change Content</button>
</body>
</html>