Display waiting screen while query get executed..

Discussion in 'PHP' started by kailashr2k, Jun 8, 2008.

  1. #1
    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>
     
    kailashr2k, Jun 8, 2008 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    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! :)
     
    EricBruggema, Jun 10, 2008 IP