"1"
<script type= "Text/javascript" > $ (Function () {$ ("#btnClick"). Click (function () {var id=$ ("#U Serid "). Val (); $.get ("Loadhandler.ashx", {Id:id}, function (data, status, JSXHR) {$ ("#loadData"). Text (data); }); }); The two global events Ajaxstart () and ajaxstop () must be bound to the document element. When the Ajax asynchronous send request, when the network speed is slow, there will be a longer request than the problem, the user and so impatient will close the page. And if you can give the user some hints during the request. For example: trying to load ... Then the user may wait a little longer and experience a better job. jquery provides two global events, Ajaxstart () and Ajaxstop (), which trigger the Ajaxstart () event as long as the user triggers Ajax and the request begins (just to prepare to start the request and not complete the request). Ajaxstop () event $ (document) is triggered when the user request ends. Ajaxstart (function () {$ ("#loadMes"). Show ();}). Ajaxstop (function () {$ ("#loadMes"). Hide (); alert ("Load Complete")}); Of course we can also separate to write $ (document). Ajaxstart (function () {$ ("#loadMes"). Show ()}); $ (document). Ajaxstop (function () {$ ("#loadMes"). Hide (); alert ("Request Complete")}) </script>
When you click the Submit button, the "I'm trying to load ..." is displayed.
Trigger Ajaxstart when Ajax starts executing () | Trigger Ajaxstop after Ajax execution ()