Home » sharepoint » SharePoint 2013 » Adding References to jQuery for Scripts for SharePoint Server 2013 and Choosing Where to Store Libraries

Adding References to jQuery for Scripts for SharePoint Server 2013 and Choosing Where to Store Libraries

As Marc Anderson notes at the start of the “Getting Started” video tutorial opening our course on SP13-306 SharePoint 2013: JavaScript and jQuery, jQuery is simply a unique set of functions, written entirely in JavaScript, which, nevertheless, streamline development, dramatically.

In order to implement functions from jQuery, eferences to the jQuery library must be added to web pages. Marc Anderson presents several options for SharePoint 2013 developers. For example, In a SharePoint 2013 environment, developers can choose to include references in a Master Page, or in a Page Layout, or within individual aspz pages. In turn, jQuery and related JavaScript files can be stored in a Document Library, within the _layouts folder, or retrieved from a Content Delviery Network (CDN) (this latter option will require connecting to locations across the internet, so administrators will need to decide on the appropriateness of this approach from a security standpoint.

If connecting to a CDN is acceptable, then firewall settings may need to be changed to permit an “always on” state for these connections to external sites). As long as the reference can be reached with a browser by calling a URL, then the reference will work fine. Marc does recommend administrators confirm network bandwidth prior to deciding on where to store jQuery and the related .js files. Of course, scripts need to access reference materials as quickly as possible, so it makes sense to confirm available bandwidth before proceeding on development likely to be unusable for users across a slow network.

Marc demonstrates how to equip scripts to flexibly modify communications methods, as required should the external repository require an encrypted, or non encrypted connection. He also explains some of the differences in working with Master Pages in SharePoint 2013, versus earlier server versions.

Of course, the purpose of adding these references to scripts is to enable use of jQuery.

Ira Michael Blonder

© Rehmani Consulting, Inc. & Ira Michael Blonder, 2013 All Rights Reserved