Joel's SharePoint Architect Blog

SharePoint 2013 Training, Architecture, Administration and Development

Subscribe Subscribe  View Joel Jeffery's profile on LinkedIn
joelblogs.co.uk | joelj.co.uk | joeljeffery.co.uk | jfdiphoenix.co.uk

If you’re creating or editing a JavaScript file in Visual Studio and you would like some help creating Client Object Model code, you’re not alone.

It’s a little bit cryptic, but we can tell IntelliSense to include any JavaScript libraries you have on your development machine.

Simply place the following two lines at the top of your source code (watch out for line breaks!):

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

Then, you can get IntelliSense when you need it the most!

Enabling IntelliSense for the JavaScript Client Object Model in SharePoint 2010

Full article on MSDN available here.

Enjoy!

Technorati Tags: Development, SharePoint 2010, SharePoint 2010 Training, SharePoint Developer, SharePoint Training

 

You can leave a response, or trackback from your own site.

8 Responses to “Enabling IntelliSense for the JavaScript Client Object Model in SharePoint 2010”

  1. Paul Lawrence says:

    This doesn’t seem to include properties from the client Context object such as clientCtx.load(), or clientCtx.executeQueryAsync().
    Which js file should be included for those little buggers?

  2. Janus says:

    You are also missing a space between Server and Extensions:

    ///

    Put in the space and it works.

    • Joel Jeffery says:

      Janus, many thanks for reading, and many thanks for spotting my typo! I had a missingspace in one of the two includes. You’re a complete star!. :o)

      I’ve corrected it and hopefully now this should work for everyone :)

      Cheers!

      joel

  3. Could not get the above tags to work or what is recommended in the MSDN article.
    This works for me though:

    <script type="text/javascript" src="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\MicrosoftAjax.js" /%gt;
    <script type="text/javascript" src="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.debug.js" />
    <script type="text/javascript" src="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.Core.debug.js" />

  4. Ethan Lynkx says:

    for *.aspx

Leave a Reply