开发者

jQuery - Disable HTML Page until .load calls is done

开发者 https://www.devze.com 2023-01-11 17:37 出处:网络
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 aw

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 syn开发者_JAVA技巧c 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 });
}


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号