Tuesday, December 29, 2015

SharePoint 2013: ExecuteOrDelayUntilScriptLoaded not executing after page publish


In SharePoint Client Object Model and after migration from SharePoint 2010 to SharePoint 2013 your Client Object Model code is running well when the page is Unpublished but once you Published it your Client Object Model Code is not working, don't worry this is not a bug but Microsoft did some changes in the "ExecuteOrDelayUntilScriptLoaded" method in SharePoint 2013 and renamed it to be "executeFunc"
Example:
SharePoint 2013 Code:
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);
function sharePointReady() {
   alert("Ready");
}
SharePoint 2010 Code:
ExecuteOrDelayUntilScriptLoaded(sharePointReady, "sp.js");
function sharePointReady() {
   alert("Ready");
}

References:
http://msdn.microsoft.com/en-us/library/jj245759.aspx

1 comment:

  1. Thanks for sharing such useful information. Sharepoint 2013 Issue Tracking App has mostly used help desk features of opening and resolving tickets through a user. Automated help desk is mandatory facility to be provided to employees & clients in today’s world. Help desk service ensures that all the issues are tracked and marked as knowledge base for future reference wherever applicable. Cubic Logics offers Office 365 sharepoint app development and services and cloud computing that enables you in selecting right solutions.

    ReplyDelete