A Practical Guide to SharePoint 2013

A Practical Guide to SharePoint 2013
A Practical Guide to SharePoint 2013 - Book by Saifullah Shafiq

Thursday, February 28, 2013

JQuery functionality does not work in your SharePoint pages!!

Scenario: You develop something using JQuery in a SharePoint page. The page loads fine on your machine but when you deploy it, users are not able to use the functionality. Page loads fine and users see it so you think it's not permissions related. Here are some tips you should try to resolve the issue:

1. Most common mistake that people make is that they forget to publish the jquery library file. Of course, this happens only if you store jquery library file in your SharePoint site. Some people store the file in the _layouts folder. Some access it directly from a CDN. In case, you are storing in SharePoint site, make sure all users have read access to that site or library. Then make sure, you have published the jquery file as a major version. Right click jquery file and click "publish a major version". Now all users should be able to use the jquery functionality

More detail: If you the jquery file has not been published as a major version, users can still use it but you will have to give them contribute permissions. Read permissions will not work. If you want users to be able to use jquery with the read permissions, then publish the jquery library file as a major version.

2. If you are storing jquery library file in "Styles Library", make sure all users have at least read access to this library.

3. Recheck the jquery path in your code. It may be pointing to your test or development environment. Make sure the path is correct.