BuddyJoe
BuddyJoe

Reputation: 71101

jQuery - Disable HTML Page until .load calls is done

What is the easiest way to disable an entire HTML page until an initial .load call is complete? What I mean by disable is the user can not interact with it in any way. It is ok for them to navigate away.

I am using jQuery 1.2.6. Is it to set the call to be sync instead of async? how do you set options for this on the .load function?

UPDATE
this seems to be working - am I off base?

function doSomething() {
     $.ajaxSetup({ async: false });
     $('#someArea').load('... args ...');
     $.ajaxSetup({ async: true });
}

Upvotes: 2

Views: 2288

Answers (1)

Robert Koritnik
Robert Koritnik

Reputation: 105029

Block with HTML+CSS, unblock with jQuery

The best way would be to have your HTML with the overlaid DIV that blocks all clicks to the content of the page. So it acts as a mask. This mask would have to be positioned, dimensioned and styled using CSS.

When page load happens, you can use jQuery and remove this mask hence enable your page.

Upvotes: 10

Related Questions