Thursday, December 18, 2014

Blocking the UI till your ajax request complete

Required JS plugin for block UI.<script type="text/javascript" src="js/jquery.blockUI.js"></script>
$(document).ready(function(){
  $(document).ajaxStart(function(){
  $.blockUI({ message: '<img src="images/wait.gif" /> Computation in progress...' });
  });
  $(document).ajaxComplete(function(){
   $.unblockUI();
  });
});

No comments: