Old web site requires sometimes to show a big “Loading…” gif in the front of the page. It is not trivial to do it, especially if you have already plenty of jQuery forms developed, with complex form submission, and half the site in an ajax form.
A small solution of this problem is to use the jQuery delegate function…and a lot of debugging.
Try out this code:
The first delegate apply to the standard form submission, and works well on plain vanilla html pages.
When the new page is loaded, the gif will disappear with the entire old body.
The last line ensures also images contained in link will be properly managed: for instance menu images , outside forms.