PDA

View Full Version : Possible to show browser loading during AJAX request?



darren
24 Feb 2010, 2:04 PM
Is it possible to make the browser act like its loading during an AJAX request?

Thanks,
Darren

bclinton
24 Feb 2010, 2:18 PM
Is it possible to make the browser act like its loading during an AJAX request?


If you mean affect the browser animations, I doubt it but maybe someone else can tell you for sure.

I think a good way to to give the user feedback on AJAX requests is to change the cursor to an hourglass and then change it back to the default when the requests completes.


Ext.fly(element).setStyle('cursor', 'wait');

Wedgie
24 Feb 2010, 3:00 PM
I use Ext.LoadMask for this, but there are many ways to provide feedback to the user that the request is being processed.

darren
24 Feb 2010, 3:41 PM
I used your method Clinton, thanks. I was curious because when I used to work with Prototype there was a script I think it was called lowpro that used the browsers loading bar when AJAX was processed.

evanc
24 Feb 2010, 3:58 PM
You could just read the source for "lowpro" and figure out how they did it.

off the top of my head: spawn a new iframe and call document.write() inside it to start the throbber, and document.close() to stop it. Not sure how well that would work to be honest, or in which browsers.