Using jQuery for CSR

There are a few useful CSR utility solutions that require jQuery to be available to the CSR script. If you are an IW / Power User you don’t necessarily need to know how to use jQuery explicitly, but there are some easy templates that only work by using it.

If jQuery isn’t already enabled for your site, you need to add the jQuery file and a link to it on the page you’re using it on.

  1. Download the latest version of the file from HERE. Get the ‘…compressed, production…’ version.
  2. Copy the file to your Scripts library (just to be consistent with where your other CSR files are).
  3. On the page you are using jQuery dependent CSR, add a Script Editor web part.
  4. In the Editor web part, add the following line – or similar based on where your file is located. This worked for me by having the file in my Scripts library:
    <script language=”javascript” type=”text/javascript” src=”../Scripts/jquery-2.1.3.min.js”></script>”

Note: Take a peek at Marc’s post on jQuery to make sure your file is working properly.

CSR that uses the jQuery library should now function properly.

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.