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.

Julien Pierre
  • 71
  • 1
  • 3

1 Answers1

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.

Akshay Randive
  • 2,875
  • 1
  • 16
  • 31
  • 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 06 '15 at 15:57
  • Good question!! – Goshky Jan 11 '17 at 16:05