There are many different approachs to using jQuery with SharePoint. Here is a summary of several different methods I have used, including how to get it to play nicely with NuGet.
1. Decide where to put jQuery files
i. In a site collection Document Library
Putting the scripts in Style Library is the main choice here, as it is available across all templates (whereas libraries such as Site Assets are only in team sites). The feature needs to be activated to make the scripts available.
- In your Visual Studio SharePoint project, right click the project and select Add > New Item…
- Select Module, and use the name ‘Scripts’.
- Configure an appropriate Site Collection (SPSite) level feature to reference the module; this can be a new feature, or added to an existing one.
- Rename Elements.xml to Scripts.xml (I like to give each Elements file a different name, so I can…
View original post 808 more words