Thanks to everyone. I found a solution:
HTML code:
<div id="spinner" class="spinner" style="display:none;"> Getting value. Please wait....<br> <img id="img-spinner" src="loader.gif" alt="Loading"/> </div> $(document).ready(function(){ $("#spinner").bind("ajaxSend", function() { $(this).show(); }).bind("ajaxStop", function() { $(this).hide(); }).bind("ajaxError", function() { $(this).hide(); }); });
source share