SharePoint 2013 On-Premise Client Side javascript

I have been developing a SharePoint 2013 / Project Server 2013 solution for some post project site provisioning tasks at one of my clients lately. The easy way of fixing this is of course the server side object model, SharePoint API’s and .NET code for some nice efficient but running in worker process solution.

I initially wanted a client side solution, better customizable, less intrusive server side and a nice technical challenge for me (not the least important :)).

After some research I determined that javascript would be the platform of choice, REST services, .NET code, Powershell everything was possible, but integration in a SharePoint page on a project site was the deciding factor.

A short list of Pros and Cons:

  • Pro: easy editing via SharePoint designer or some other client side tool, easy deploying (just placing a new js file) and easy integration a SharePoint page.
  • Con: executed in the users browser (talking about dependencies :(), asynchronous calls (SharePoint ClientContext can only be updated via executeQueryASync method in SharePoint 2013).

Tools for editing, debugging and testingĀ are widely available. Visual Studio, SharePoint Designer but also the Chrome, Internet Explorer and Firefox developer / debugging tools are very handy when debugging your javascript (not the least the debugger; command in JS).

The most interesting of this post is of course the links I found interesting while developing my client side solution, here they come:

Basic operations via JSOM in SharePoint 2013:

http://msdn.microsoft.com/library/jj163201.aspx

Check if SharePoint javascript libraries are loaded client side -> ExecuteOrDelayUntilScriptLoaded function

Building a Javascript Library in a decent way: http://www.sharepointnutsandbolts.com/2014/09/provisioning-managed-metadata-taxonomy-fields-three-cloud-friendly-ways.html

Use of promises and deferred to get the clientcontext a little more synchronous: http://www.shillier.com/archive/2013/03/04/using-promises-with-the-javascript-client-object-model-in-sharepoint-2013.aspx

When and done pattern use of jquery:

http://www.shillier.com/archive/2013/03/11/using-the-when-done-pattern-with-promises-in-sharepoint-2013-apps.aspx

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.