Skip to main content

JQuery Integration with Sharepoint

JQuery changed the way we write javascript and easy to use.So JQuery become a must have for most of the developers around the world. We all are start working with sharepoint 2010 so one of the intresting question around the sharepoint world is Did Sharepoint 2010 ships with JQuery?. I was also curious about it so I was searching in the 14 hive folder in 2010 but there is no luck.So final answer to the JQuery Integration will be No Its not part of the Sharepoint 2010.
So it will be interesting to see how we could use JQuery in Sharepoint. Now JQuery could be used in two different way.
1. CDN Hosted JQuery
A number of large enterprises provide hosted copies of jQuery on existing CDN networks that are available for public use.

http://code.jquery.com/jquery-1.4.4.min.js Minified version
http://code.jquery.com/jquery-1.4.4.js Source version

Read More

2. JQuery from Local Server

Next approach will be download JQuery from the official site and save in your local server , then refer like any other JS file.

How to use in a Sharepoint page?
Download the JQuery jquery-1.4.4.min.js and copy to the layout folder (c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS) in 14 hive (12 hive for sharepoint 2007) .Now we are good to use JQuery in any of the Pages in any site collection.
1. Add the script link in html head section of the page

<script type ='text/javascript' src='/_layouts/jquery-1.4.4.min.js' ></script >
Once you added the Script link tag you co


2. Add the script link in html head section of themaster page

<script type ='text/javascript' src='/_layouts/jquery-1.4.4.min.js' ></script >

Comments

Popular posts from this blog

How to find Sharepoint DB

In sharepoint world you should know where the sharepoint database is to trouble shoot database related issues.Some one come to you and say i am getting unable to connect to database error or my sharepoint is down.So you may not know the details of the environment.In first step you need to identify the  servers so you have to find the configdb and content db servers. How to find the Config DB Configuration database connection string is stored in Registry key. So sharepoint look for that entry to identify the database. In Sharepoint 2007 you could see the config DB conection string in Following Registry Key My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDb In Sharepoint 2010 you could see the config DB conection string in Following Registry Key My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDb The Next thing you have to find the Content DB attached to Web application.

Ajax Integration with sharepoint

Master Page 1. Add the following tag just below the form tag of master page <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" /> Web.Config 1. Add safe control <SafeControl Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TypeName="*" Safe="True" /> 2. Add the http handler inside <httpHandlers> tag of web.config <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

Creating Custom Timer Job

Timer Job is something which comes into mind when you are looking for batch process in sharepoint.In most of the realtime sharepoint site requires Pulling data from some other application and update the data in sharepoint.In some other scenario we need to synchronize information or Updata date in every day, or give the admin a flexibility execute some batch processing.Its realy good idea to create a Custom Scheduled Job.Let see a Basic skelton code. using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; //Class should inherit from  SPJobDefinition Public class SampleJob :  SPJobDefinition {        //You could Define Custom properties         [Persisted()]         public string MyCustomProperty; ///Implement Following three constructors public SampleJob (): base(){  } public SampleJob (string jobName, SPService service, SPServer server, SPJobLockType targetType): base (jobName, service, server, targetType) { } public SampleJob (string jobName, SPWebAp