View Full Version : show loading image when updating page?

11-03-2008, 01:48 PM
hello guys,

how can i show an animated gif when user clicks a link and page uplaods?

i just want the gif to be displayed over the content, then when the data has been retrieved, the page can be updated (and content changes).

11-03-2008, 02:02 PM
in your ajax request you need to use a statement for the onReadyStateChange for 2 or 3 i think. 2 being request sent, 3 says it's being processed.

11-03-2008, 05:11 PM
thanks man, but i know how to do the ajax part.

i dont know how to put the gif over the content.

please help :)

11-03-2008, 06:46 PM

just make a div, style it how you want and hide it by default with display: none;

then at the beginning of your call show it, and when it's complete hide it again

as for the styling, that's all css. to make it show up on top of everything else tweak it's zindex. after that it's just positioning.