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?
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.
Do you mean the initial page load or do you mean dynamic/asynchronous loading via Ajax?
Quote:
Originally Posted by Mishu
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.