How To Enable IntelliSense For jQuery in Visual Studio 2010


VS IntelliSense doesn't know anything about jQueryBy default IntelliSense in Visual Studio doesn’t know anything about jQuery. So for instance if you try get some help as soon as you type ‘$’ IntelliSense won’t suggest you anything useful. You can see that on the right.

Luckily enabling support for jQuery is very simple, I will show you how to do it in a few simple steps, but first let’s make sure that we are in the same starting point.

  1. Make sure that you have jQuery included in your project. If you created your application by choosing ‘ASP.NET Web Application’ then check folder Scripts. Look for files jquery-1.4.1.js or jquery-1.4.1.min.js – it should be there. If for some reason those files are not there, you can always download them form jQuery.com and manually add to the project.
  2. Make sure that jQuery documentation for Visual Studio is also included. Look for file jquery-1.4.1-vsdoc.js. Again it should in Scripts folder. If not, download for jQuery.com.

How to enable IntelliSense for jQuery

  1. Create new JScript file
  2. Drag & drop jquery-1.4.1-vsdoc.jsfile into the new javascript file.

    IntelliSense drag-and-drop

    when this is done your JS file should loke like this:

    /// <reference path="jquery-1.4.1-vsdoc.js" />
  3. Now you can start using IntelliSense, here are a few examples:

    jQuery IntelliSense
    jQuery IntelliSense 2

    jQuery IntelliSense 3

  4. Enjoy! :)

jQuery 1.6.2 Update

Currently the latest version if jQuery is version 1.6.2. Here you can download jQuery 1.6.2 documentation for Visual Studio.

VN:F [1.9.14_1148]
Rating: 7.7/10 (3 votes cast)
How To Enable IntelliSense For jQuery in Visual Studio 2010, 7.7 out of 10 based on 3 ratings

  1. No comments yet.
(will not be published)