Call jQuery to SharePoint page using Content Editor web part

In this article we will discuss about how we can call jQuery into a SharePoint page using content editor web part. In my previous articles I have explained about how to deploy jQuery to SharePoint using solution package. After you deploy jQuery to SharePoint, it is time to call jQuery to SharePoint page.

There are different ways you can call jQuery libraries to SharePoint page like:
– By using content Editor web part
– By using custom actions
– By dynamically through code
– By adding the script to the master page etc.


If you want to learn SharePoint online then you can Download a FREE PDF on SharePoint online tutorial and Download FREE PDF on HUB site in SharePoint online. Also read SharePoint Online modern experience and Impact on InfoPath in modern UI in SharePoint online office 365.

fallow the below articles:

Content type HUB SharePoint 2013 Tutorial Part-1

In this article we will discuss how we can call through the content editor web part. This is one of the simplest approach, But jQuery will be available on the same page where the Content Editor web part is added, it will not affect any other pages. This can be used in Sandboxed environment.

Follow below steps to call jQuery through content editor webpart:

Step-1:
First edit the page on which you want to call the jQuery libraries. Then on one of the webpart zone click on Add a Web Part.

Step-2:
Then from the Media and Content category section select Content Editor web part and click on Add as shown in the figure below.

reference jquery code in sharepoint page
reference jquery code in sharepoint page

Step-3:
Then in the content editor web part Click on “Click here to add new content” to edit the contents of the web part.

Step-4:
In the Ribbon, go to the Format Text section, select HTML in the Markup group, and choose HTML Source as shown in the figure:

load jquery to sharepoint page using content editor web part
load jquery to sharepoint page using content editor web part

Step-5:
Now in the edit html source dialog box paste the below line:
<script type=”text/javascript” src=”http://siteurl/_layouts/jquery/jquery-1.6.2.min.js”></script>


Step-6:
Now Save and Publish the page.

After this step the jQuery will be avilable to the SharePoint page.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →