I’ve two individual pages which actual needs the same kind of function so I’ll combine them into one question.
The function I would like is a modal window while the page are loading but the different for the two pages is when this modal window with a waiting text should appear.
When entering pageA it has to collect and calculate a lot of data so the loading time can take some time before it is ready. For this page I would like the waiting sign to come until the page is finish loading.
PageB is a form. The page loads fast but when a user hits the submit button the code does some different things with the data so it too can take some time and here I would like the modal javascript waiting sign to come when pressing submit. I do all the collecting, checking, validating and inserting on the same page, PageB, so I’m not changing back and forth between two pages.
I’ve scouted Google and different jQuery / JavaScript pages for a solution but what I’ve been struggling with is that it should work on both kind of pages, if that’s possible, or otherwise create two functions one for each page.
I’ve also searched stackoverflow but the question which is somewhat similar is not quite what I’m looking for either or I simple just doesn’t understand the solutions good enough.
Any help, suggestion or tips would be very much appreciated.
Sincere
– Mestika
Take a look at the jQuery UI Dialog – it has everything you need …
http://jqueryui.com/demos/dialog/
For pageA call the function in a
<script>tag at the top of the page and close it in the$(document).ready()functionFor pageB call the function when the form is submitted and close it once that processing has been completed …