I want to display a waiting screen while my database fetches some data. I am using ajax and jquery for that. Cam any one suggest me to find out the code. I have a code but it is used to display loading screen while the page load here it is. <html> <head> <title>Base page for content</title> <script src="jquery.js" type="text/javascript"></script> </head> <body> <div id="contentLoading" class="contentLoading"> <img src="VideoLoading.gif" alt="Loading data, please wait..."> </div> <div id="contentArea"> </div> <script type="text/javascript"> jQuery(function($) { $("#contentArea").load("air.php"); }); $().ajaxSend(function(r,s){ $("#contentLoading").show(); }); $().ajaxStop(function(r,s){ $("#contentLoading").fadeOut("fast"); }); </script> </body> </html>
Queries will be executed before sending anything to the screen, if you use flush (php) you can send data to the browser while still executing the script but handy is something differend!