5

I am confused about the idea of SP.SOD.executeFunc and other ways of referencing JavaScript, like:

  • SP.SOD.execute

  • SP.SOD.executeFunc

  • ExecuteOrDelayUntilScriptLoaded

  • SP.SOD.executeOrDelayUntilScriptLoaded

  • LoadSodByKey

I have read this post: What is difference between executefunc and executeordelayuntilscriptloaded?, but there's no detail.

5

execute : Executes the specified function in the specified file with the optional arguments.

executeFunc: Ensures that the specified file that contains the specified function is loaded and then runs the specified callback function.

executeOrDelayUntilEventNotified : Executes the specified function if the specified event has occurred; otherwise, adds the function to the pending job queue.

executeOrDelayUntilScriptLoaded : Executes the specified function if the file containing it is loaded; otherwise, adds it to the pending job queue

LoadSodByKey : function provided by the SharePoint JavaScript framework in order to dynamically load the script.

  • Thank you Akshay, but the function doesn't have to be inside the file. I can call a function but make sure another file like sp.js is loaded, are you referring to case like this or referring to the function inside the same file exactly? – Julien Pierre Jul 6 '15 at 15:57
  • Good question!! – Goshky Jan 11 '17 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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