Saturday, December 27, 2014

JSOM Basics

JSOM required Libraries:
MicrosoftAjax.js - Loaded via ScriptResource.axd
SP.runtime.js - Loaded directly from layouts folder
SP.js - Loaded from Layouts folder

Only in the context of a Site Collection and not beyond it. Can only run in the context of current user.

Also use _context = new SP.ClientContext("subsite url");
Also use _context = new SP.ClientContext.get_current()

ERROR HANDLING in JSOM

Interesting Program that creates a list in the catch block if it does not exist yet. Also see the use of Javascript Parser


No comments:

Post a Comment