Displaying loading image

Two ways...


1)

<div>
<script type="text/javascript">
$.ajaxSetup({
               beforeSend: function () {              
                      $("#loadingmessage").show();
                 },
       complete: function () {            
      $("#loadingmessage").hide();
            }
        });
    </script>
</div>

2)


SHOW LOADING IMAGE 

$('#loadingDiv')
    .hide()  // hide it initially
    .ajaxStart(function() {
        $(this).show();
    })
    .ajaxStop(function() {
        $(this).hide();
    })
;


No comments:

Post a Comment