SP2013 support for publishing pages (fix)

Feb 2, 2015 at 6:46 PM
Sometimes you will need to call the setup function via the new SOD function in SP2013. Especially for publishing pages. The "ExecuteOrDelayUntilScriptLoaded" function isn't the proper fuction to use, in SP2013 (according to MS).

I changed the code to accomidate this (quick 'n dirty)
In Sprello.cs:

Out with this (or comment out):
writer.Write("ExecuteOrDelayUntilScriptLoaded(function(){ExecuteOrDelayUntilScriptLoaded(sprello_setup_" + this.ID + ",'sp.js');},'core.js');");
Add this instead:
writer.Write("SP.SOD.executeFunc('core.js', 'SP.ClientContext', SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sprello_setup_" + this.ID + "));");
Coordinator
Feb 2, 2015 at 8:21 PM
Cheers Hhrafn!
Coordinator
Feb 2, 2015 at 8:23 PM
Cheers Hhrafn!