SharePoint 2010: Show Dialog on Page Load
A quick tip…
Because the sp.ui.dialog.js library is lazy-loaded, it may not be available when the page is ready/loaded. I’ve seen some early examples where if you wanted to do something on page load, you use:
_spBodyOnLoadFunctionNames.push("YourInitFunction()");
This will not work if you want to open a SharePoint dialog on page load. Instead use:
ExecuteOrDelayUntilScriptLoaded(YourInitFunction, "sp.ui.dialog.js");
Categories: Development, JavaScript, SharePoint