jquery ajax Request shows loading ...
$ (' #btnTest '). Click (function () {
$.ajax ({
URL----, set URL path according to your needs
Type: ' Post ',
Data: ' Name=test ',
timeout:15000,
Beforesend:function (XMLHttpRequest) {
Alert (' Remote call starts ... ');
$ ("#loading"). html. ("
Displays the text $ ("#loading"). html. ("},
Success:function (data,textstatus) {
Alert (' Start callback, status text value: ' +textstatus+ ' return Data: ' +data ');
$ ("#loading"). empty ();
},
Complete:function (xmlhttprequest,textstatus) {
Alert (' Remote call succeeded, status text value: ' +textstatus ');
$ ("#loading"). empty ();
},
Error:function (Xmlhttprequest,textstatus,errorthrown) {
Alert (' Error ... Status text value: ' +textstatus+ ' exception message: ' +errorthrown ';
$ ("#loading"). empty ();
}
});
});
<div id= "Loading" ></div>
< input type= "button" id= "btntest" value= "Test" >
jquery ajax Request shows loading ...