views:

193

answers:

3

Ok. I'm making an ajax-enabled lab scheduling program, and some of the ajax operations aren't exactly quick. In Gmail, when you go to your inbox, send a message, etc. the browser acts like it's loading (In FF the stop button becomes enabled, the progress bar appears), but it's not on a new page, it's done via AJAX. How do they do this? I have a little spinny indicator, but it would be a nice touch to have the browser act like it's loading. Any ideas? Thanks in advance.

A: 

This article has details about different types of requests and whether they trigger busy indicators like the progress bar.

Annie
hmmm. interesting. is there some function I can call, something to do that triggers it (I don't want to change all my request types and stuff)?
Michele N.
A: 

AJAX cannot trigger the browser's "loading" mechanism, as the first A in AJAX is "Asynchronous", meaning (in so many words) that calls are done without refreshing the page. In actuality, when you see the "loading" bar pop up the page is being refreshed, but in FF, it doesn't look like it is because of the way it caches.

Jason
Then how does gmail's 'loading' thingy in the top-center stay there the whole time, and go away at the right time?
Michele N.
@Michele: The "Loading" notice at the top of your screen is probably just given `display:block;` when the script starts and given `display:none;` when it's finished. That's much different from getting the progress bar to appear.
Jeff Rupert
A: 

Think this is your answer:

http://www.obviously.com/tech_tips/slow_load_technique

Looks like gmail and facebook method (browser is showing page as "loading" with loading icons etc. - it is just simulating, because there is a background ajax request) :)

s3m3n