Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a share point site i noticed the menu loads slow.its a customized menu based on a list and jquery.I load the script on my masterpages I would prefer this menu to load last after all the other script has loaded. I read about scriptlink vs traditional script tag but not sure if this will help. Any tips,ideas and resources would be appreciated. Cheers

share|improve this question

1 Answer 1

"If you aren't dynamically loading scripts or marking them as defer or async, then scripts are loaded in the order encountered in the page. It doesn't matter whether it's an external script or an inline script - they are executed in the order they are encountered in the page. Inline scripts that come after external scripts have are held until all external scripts that came before them have loaded and run.

Async scripts (regardless of how they are specified as async) load and run in an unpredictable order. The browser loads them in parallel and it is free to run them in whatever order it wants.

There is no predictable order among multiple async things. If one needed a predictable order, then it would have to be coded in by registering for load notifications from the async scripts and manually sequencing javascript calls when the appropriate things are loaded.

When a script tag is inserted dynamically, how the execution order behaves will depend upon the browser. You can see how Firefox behaves in this reference article. In a nutshell, the newer versions of Firefox default a dynamically added script tag to async unless the script tag has been set otherwise."

From this forum

http://stackoverflow.com/questions/8996852/load-and-execute-order-of-scripts

Hope this helps!

[EDIT] Based on your comment:

  1. If you are looking for the SPLongOperation. Please have a look here http://www.sharemuch.com/2010/01/22/displaying-sharepoint-2010-processing-page-during-your-long-running-custom-operations/

  2. http://bramdejager.wordpress.com/2011/03/21/using-sp-ui-dialog-and-sp-ui-notify-from-code-behind/

  3. http://stackoverflow.com/questions/2813590/ajax-loading-icon-with-updatepanel-postbacks

share|improve this answer
    
Thanks Anuja. How about showing a loading... button and then after the data is loaded append to element. cheers –  naijacoder Nov 5 '12 at 12:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.