Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading indicator issue

Status
Not open for further replies.

tamak

Programmer
Sep 6, 2006
19
US
Im building an app that shows a loading .GIF animation while the data is being fetched from the database... this issue isnt really an 'issue' persay, but rather a trick Im trying to get to work...

I'd like to know if its possible to 'stall' the return of the data, say 4 seconds AFTER the onReadyStateChange signaling the data is ready to display.

This would allow the user to see more of the loading gif,and that sounds crazy Im sure, but I'd like to know if its possible.

what would the javascript for something like that look like? Is it as simple as giving the javascript a task like 'count xx seconds then proceed'?
 
You might set a variable before you fire off the request, and on the callback, check the "time since request"... and then start a setTimeout() with the difference to make up 4seconds... the idea that the setTimeout would then update your page.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top