Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Loading image?

  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    86
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Loading image?

    Hey,

    I need it so that when the content of my page is loading, a loading image is shown. If content is in the container, that all clears and the loading image shows until it has loaded or for X seconds?

    Thanks

    ~ David

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,355
    Thanks
    11
    Thanked 558 Times in 551 Posts
    Do you mean the initial page load or do you mean dynamic/asynchronous loading via Ajax?

  • #3
    Banned
    Join Date
    Mar 2012
    Posts
    306
    Thanks
    1
    Thanked 28 Times in 28 Posts
    Thius is an ajax forum so I assume you mean with ajax.

    When the ajax function is called, delete any content using DOM methods and then display a loading image. In your ajax object's onreadystatechange handler, when the readystate = 4 and the status = 200, hide the loading image and display the new content.

  • #4
    New Coder
    Join Date
    Dec 2011
    Posts
    86
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by devnull69 View Post
    Do you mean the initial page load or do you mean dynamic/asynchronous loading via Ajax?
    Quote Originally Posted by Mishu View Post
    Thius is an ajax forum so I assume you mean with ajax.

    When the ajax function is called, delete any content using DOM methods and then display a loading image. In your ajax object's onreadystatechange handler, when the readystate = 4 and the status = 200, hide the loading image and display the new content.
    I'm using Hash tag ajax, so when site.com/#!/example is visited, example is loaded. I need this to load an image.

    Thanks

    ~ David


  •  

    Posting Permissions

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