Xrender
Xrender

Reputation: 1445

Jquery Wait/Page Loading

This question is more than just a 'wait' dialogue, I basically have a search service which can take several seconds to load. So you would start on a search form, and click search and then this will go to another page (which can take several seconds to load e.g. come from the server). I don't want to make this an ajax call, I do want it to go from page A to page B however I would like to be able to implement a loading page until the second page has come back from server. Nearest I have found is on

http://www.holidayautos.co.uk

Where user waits on the first page until the second is ready, could anyone advise on using jquery the best way of doing this?

Upvotes: 0

Views: 1742

Answers (2)

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114417

First, show your "loading" overlay.

Then create a hidden Iframe with an "onload" event and point it to the new page. When the onload fires, show the Iframe and hide your overlay.

This is the only way you can tell another page has "loaded" while maintaining control over the current page.

Upvotes: 2

GordonM
GordonM

Reputation: 31780

You probably want the BlockUI plugin. It will allow you to put an overlay over a page with a message on an event. Simply attach BlockUI to the form.submit event and you should be all set.

http://jquery.malsup.com/block/

Upvotes: 0

Related Questions