I am new to jQuery and I have a piece of code inside the ready function that takes about 4-5 seconds to finish. What I'd like to do is to probably use blockUI to show a "Please wait" message or something while the page is loading. However, if I insert the $.blockUI and $.unblockUI inside the ready function it just runs and disappears right away. If I put it outside, it trashes IE6. Any ideas? I don't necessarily need to use the BlockUI plugin, anything else would do.
Thanks!
EDIT: Thanks everyone for the feed back. My code is pretty long so I did not want to post it here, but it basically builds a tree of checkboxes and the tree is pretty long about 1000 leaves. So it goes about picking the checked ones and expand them, hide the unchecked ones, and so on and so forth. I know I can try to optimize it a little more, but I guess I am also curious about how to do this. So basically I am not doing any post, get, or ajax calls that I can attach the unblock code to it. Most of the statements are selecting some nodes and adding/removing some attributes, like hide, show, etc.
I did some profiling with yslow and it seems that the load time is divided between the html being parsed (~2.5 sec) and the javascript code (~2.5). Which got me thinking if there is a way to have the blockUI fire as soon as the page load, before the jquery ready function returns true.
Thanks all!
Thanks again everyone!