Home > Development, JavaScript, SharePoint > SharePoint 2010: Show Dialog on Page Load

SharePoint 2010: Show Dialog on Page Load

February 11th, 2010 Leave a comment Go to comments

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");
  1. No comments yet.
  1. No trackbacks yet.