I am new to jQuery and I have a piece of code inside a finished function that takes about 4-5 seconds. What I would like to do is use blockUI to show a βWaitβ message or something else while the page is loading. However, if I insert $ .blockUI and $ .unblockUI inside the finished function, it just starts and disappears right away. If I pulled it out, it will mix IE6. Any ideas? I don't have to use the BlockUI plugin, anything else.
Thanks!
EDIT: Thanks to everyone for the feedback. My code is quite long, so I did not want to publish it here, but it basically creates a flag tree, and the tree is quite long with about 1000 leaves. Thus, he is going to select proven ones and expand them, hide unverified ones, etc. Etc. I know that I can try to optimize it a little more, but I think I'm also interested in how to do it. So basically I donβt make any messages, receive or ajax, which I can attach an unlock code to it. Most statements select some nodes and add / remove some attributes, such as hide, show, etc.
I did some profiling with yslow and it seems that the load time is divided between the parsed html (~ 2.5 sec) and the javascript code (~ 2.5). Which made me wonder if there is a way to block fireUI immediately after the page loads, until the jquery ready function returns.
Thanks everyone!
Thanks again everyone!
source share