Posted By

housecor on 01/11/11


Tagged

page block unload pageunload


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

wirenaught


Show preloader message when page is unloading


 / Published in: JavaScript
 

URL: http://jquery.malsup.com/block/

This works cross browser. Merely using onclick on a submit button to show a preloader/ please wait dialog doesn't work in IE since it doesn't show images once the page is being unloaded.

  1. <script type="text/javascript" src="https://github.com/malsup/blockui/raw/master/jquery.blockUI.js"></script>
  2. <script type="text/javascript">
  3. $(document).ajaxStop($.unblockUI);
  4. $(document).ready(function () {
  5. $('#lnkBtnPrevious').click(function () {
  6. $.blockUI();
  7. });
  8.  
  9. $('#lnkBtnContinue').click(function () {
  10. if (typeof (Page_ClientValidate) == 'function') {
  11. Page_ClientValidate();
  12. }
  13. if (Page_IsValid) {
  14. $.blockUI();
  15. }
  16.  
  17. });
  18. });
  19. </script>

Report this snippet  

You need to login to post a comment.