Chaks' Corner

SharePoint and other stuffs

16. June 2010 13:22
by Chaks
1 Comments

SharePoint 2010 EcmaScript(JavaScript) IntelliSense in VS2010

16. June 2010 13:22 by Chaks | 1 Comments

If you are using JavaScript Client OM for building SharePoint 2010 solutions, especially manipulating the Ribbon, building modal dialog boxes etc., , you might be wondering how I can get IntelliSense working for my JavaScript code.

 

It is actually very simple. At the top of your .js file, you need to add the following:

 

/// <reference name="MicrosoftAjax.js" />
/// <reference path="file://C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/14/TEMPLATE/LAYOUTS/SP.core.debug.js" />
/// <reference path="file://C:/Program Files/Common Files/Microsoft Shared/Web Server Extensions/14/TEMPLATE/LAYOUTS/SP.debug.js" />

 

Depending on your needs, the .js files may change, but you have to include MicrosoftAjax.js.

 

After saving the .js file, press Ctrl + Shift + J  to update the JavaScript IntelliSense.

 

Tip: Sometimes, you might have to press Ctrl + Shift + J for each .js file referenced.

 

After this, I now get the intellisense:

 

JavaScript IntelliSense

 

You can find more options here: http://msdn.microsoft.com/en-us/library/ff798328.aspx

Comments (1) -

Aroh Shukla

Thanks a lot ...I was looking for this tip but could not found over the Internet.

Comments are closed