.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Articles >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Articles

JQuery and SharePoint

Posted By:Jean Paul       Posted Date: August 30, 2014    Points: 200    Category: SharePoint    URL: http://www.dotnetspark.com  

In this article I will explain how to use JQuery in SharePoint.

jQuery is a fast, small, and feature-rich JavaScript library.  As part of customizations, we might needed to include jQuery in a SharePoint page.  Following is one of the way to achieve it.

  1. Add jQuery file to Site Assets library
  2. Edit the Page
  3. Insert Content Editor web part
  4. Insert jQuery code
  5. Test page

I am expanding each of the steps

Step 1: Add JQuery file to Site Assets Library

Download jQuery.js from the following location:


You can choose a compressed/non-compressed version:


Rename & Upload the file to Site Assets library, for faster access.


Step 2: Edit the Page

Choose Site Actions > Edit Page to bring your page in edit mode.


If you are using New/Edit pages of list/library, you can read this to enable Editing.

Step 3: Insert Content Editor web part

Click Insert tab & choose Media and Content > Content Editor Web Part.


After insertion, choose the Edit Web Part option.


Click on the web part content area.

Choose the Format tab > HTML > Edit HTML Source button as shown below.


You will get the dialog box below:


(Ensure that it is a BLANK one)

Step 4: Insert jQuery Code

In the dialog box place the following code:

<script type="text/javascript" src="/SiteAssets/jquery.js"></script>

<script type="text/javascript"> 
    alert("JQuery: Hello, World!");


The dialog box now looks like:


Click OK button to close the dialog.

From the Page tab, click the Save button to save page changes too.

Step 5: Test Page

Click on the Home link & you will see the following message box.


This concludes the steps to include jQuery.




This is one way of integrating jQuery into SharePoint pages.  You can also try editing the Master Page & including jQuery.js from the server side.

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend