{"id":191,"date":"2010-02-11T11:16:01","date_gmt":"2010-02-11T19:16:01","guid":{"rendered":"http:\/\/singchan.com\/?p=191"},"modified":"2010-02-11T11:16:01","modified_gmt":"2010-02-11T19:16:01","slug":"sharepoint-2010-show-dialog-on-page-load","status":"publish","type":"post","link":"https:\/\/singchan.com\/wordpress\/2010\/02\/11\/sharepoint-2010-show-dialog-on-page-load\/","title":{"rendered":"SharePoint 2010: Show Dialog on Page Load"},"content":{"rendered":"<p>A quick tip&#8230;<\/p>\n<p>Because the sp.ui.dialog.js library is lazy-loaded, it may not be available when the page is ready\/loaded. I&#8217;ve seen some early examples where if you wanted to do something on page load, you use:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n_spBodyOnLoadFunctionNames.push(&quot;YourInitFunction()&quot;);\r\n<\/pre>\n<p>This will not work if you want to open a SharePoint dialog on page load. Instead use:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nExecuteOrDelayUntilScriptLoaded(YourInitFunction, &quot;sp.ui.dialog.js&quot;);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A quick tip&#8230; Because the sp.ui.dialog.js library is lazy-loaded, it may not be available when the page is ready\/loaded. I&#8217;ve seen some early examples where if you wanted to do something on page load, you use: _spBodyOnLoadFunctionNames.push(&quot;YourInitFunction()&quot;); This will not work if you want to open a SharePoint dialog on page load. Instead use: ExecuteOrDelayUntilScriptLoaded(YourInitFunction, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,24,43],"tags":[44,50,164,42],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-development","category-javascript","category-sharepoint-development","tag-44","tag-dialog","tag-javascript","tag-sharepoint"],"_links":{"self":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":2,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":193,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/191\/revisions\/193"}],"wp:attachment":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->