SP.SOD.executeOrDelayUntilScriptLoaded(func, depScriptFileName) Method
Applies to: SharePoint Foundation 2010
Executes the specified function if the file containing it is loaded; otherwise, adds it to the pending job queue.
SP.SOD.executeOrDelayUntilScriptLoaded(func, depScriptFileName);
Parameters
func
Type: Function
The function to execute.
depScriptFileName
The name of the file containing the function.
Type: String
Remarks
Call the SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs(scriptFileName) Method method with depScriptFileName to execute any pending jobs waiting for the file to be loaded.