www.webdeveloper.com
Results 1 to 10 of 10

Thread: Loading Page Script

  1. #1
    Join Date
    Dec 2002
    Posts
    112

    Loading Page Script

    How to show ajax loading gif animation while the page(http://www.xyz.com/....) is loading?

    <tr>
    <td>
    <br>
    <?php include("http://www.xyz.com/search.php?notice[]=1&sector=0"); ?>
    </td>
    </tr>

  2. #2
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,096
    You don't need Ajax...

    HTML Code:
    <body onLoad="document.getElementById('siteLoader').style.display = 'none';">
    <!-- loading BEGIN -->
          <div id="siteLoader"> 
            <div id="loadImg"> 
            <img src="http://cdn.nirmaltv.com/images/generatorphp-thumb.gif" border="0" align="left" style="margin-top:-12px;">
            </div> 
          </div> 
    
    <!-- loading END -->

  3. #3
    Join Date
    Dec 2002
    Posts
    112
    Thanks. Even after the page has loaded the loading image remains on the page. The link to the URL is - http://www.ittenders.com/indexx4.htm

  4. #4
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,350

    Lightbulb

    I have not found it in your code yet, but at the call to the ajax load function, do this:
    Code:
      document.getElementById('siteLoader').style.display = 'block';
    When the information has been loaded and the function finishes, do this:
    Code:
      document.getElementById('siteLoader').style.display = 'none';
    This assumes you use the <body> tag to initialize the siteLoader graphic display to be 'none'

  5. #5
    Join Date
    Dec 2002
    Posts
    112
    The loading page still remains. Please check at this link

  6. #6
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,350

    Arrow

    Quote Originally Posted by GurusGuru View Post
    The loading page still remains. Please check at this link
    You need to turn it off with the display = 'none' logic given in the earlier post
    after the AJAX has obtained the information.

  7. #7
    Join Date
    Aug 2012
    Posts
    15
    Hi, if you are using JQUERY you can try with this on the HEAD

    <script type="text/javascript">
    $(document).ready(function(){
    $('#loadImg').hide();
    });
    </script>

  8. #8
    Join Date
    Dec 2002
    Posts
    112
    Have already mentioned it -

    <body onLoad="document.getElementById('siteLoader').style.display = 'none';" style="margin-bottom: 0px; margin-left: 0px; margin-top: 10px;">

  9. #9
    Join Date
    Aug 2012
    Posts
    15
    Hi, jquery its not being loaded, you can check if the link is correct. Check on firebug and you will see when you call $(document).ready it is not being execute due to that fact. If you are checking on opera inspector you can see the jquery library is not loaded or found

  10. #10
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,096
    Here is a simple working example

    http://www.metataggenerator.org/analyzer/just-fb-id.php

    This page is actually a popup that will identify a Facebook user by their ID number, etc.

    You can examine the source code.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles