Ways to load jQuery in SharePoint (2010/2013)

Software / Wetware

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.

  1. In your Visual Studio SharePoint project, right click the project and select Add > New Item…
  2. Select Module, and use the name ‘Scripts’.
  3. Configure an appropriate Site Collection (SPSite) level feature to reference the module; this can be a new feature, or added to an existing one.
  4. 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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