Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Guille Pajares
Added: Apr 23, 2019 11:47 PM
Views: 8
Tags: no tags
  1. $(document).ajaxStart(function(){
  2.     $.LoadingOverlay("show");
  3. });
  4. $(document).ajaxStop(function(){
  5.     $.LoadingOverlay("hide");
  6. });
  7. // Now try to make a few Ajax calls, a LoadingOverlay will be shown until the last call is completed!
  8. Or, in case you need some more sophisticated control/filter, you can use .ajaxSend() and .ajaxComplete() in the same way. LoadingOverlay will take care of multiple calls thanks to its internal counter feature.
  9.  
  10. $(document).ajaxSend(function(event, jqxhr, settings){
  11.     $.LoadingOverlay("show");
  12. });
  13. $(document).ajaxComplete(function(event, jqxhr, settings){
  14.     $.LoadingOverlay("hide");
  15. });
  16. // Now try to make a few Ajax calls, a LoadingOverlay will be shown until the last call is completed!