Getting jQuery Intellisense Functioning in Visual Studio 2008

It was announced today at the Microsoft Professional Developers Conference that Visual Studio 2008 supports Intellisense for jQuery with an additional file available from jQuery.  The file is available from Google Code

There are no instructions included with the download but I took the time to get jQuery Intellisense to work in one of my ASP.NET MVC projects.   In order to get this to work I did the following:

1. Downloaded the jquery-1.2.6-vsdoc.js to the Scripts folder of my project along side my jquery-1.2.6.js file.

2. In my project I referenced the jquery-1.2.6-vsdoc.js file in my Master Page so I could reference it anywhere, like so:

jQueryUse

3. Once this is in place a simple test of function was created and Intellisense was tested:

jQueryIntellisense1

The reference to jQuery can be clearly seen here.

jQueryIntellisense2

The list of methods available as part of the jQuery library can also be seen.

This was pretty easy, the key part is making sure you have the proper path set for Visual Studio to find the jQuery JavaScript files.   I used the path as “~/script/jquery-1.2.6-vsdoc.js” and placed it after the reference to the main jQuery JavaScript file, referenced the same way. 

I hope this helps someone else trying to get this going.

5 Comments : 10.28.08

Similar Posts

  1. ASP.NET MVC Framework Preview 2 - Changes for the Better
  2. Application_Start not firing and the Global.asax
  3. 10 Alternative Ruby Web Frameworks

Feedbacks

 avatar
#1
alex grande
10.30.2008 @ 12:56 PM

I'd use this but I have to place a JS file into my websites in order to see this? What if i forget to move it? I think I'll wait until VS can embed it without a client side script. Good first steps!

rbazinet avatar
#2
Rob Bazinet
10.30.2008 @ 1:12 PM

@alex You need to use the file on your local development system, the Intellisense is only for development purposes. Once you deploy you would remove the reference to the .js file and deploy.

If you happened to forget then it is really only some extra JavaScript which only Visual Studio uses and wouldn't really be a problem except for some extra client-side JS downloads.

 avatar
#3
Sean
11.07.2008 @ 5:25 PM

If I have an existing .js file I created that my project references, how can I get intellisense while working in that .js file within Visual Studio 2008?

 avatar
#4
Sam
12.23.2008 @ 12:16 AM

thank you!

» Trackbacks & Pingbacks

  1. Pingback from ASP.NET MVC Archived Blog Posts, Page 1

    ASP.NET MVC Archived Blog Posts, Page 1 — October 28, 2008 11:36 PM
Trackback link for this post:
http://accidentaltechnologist.com/trackback.ashx?id=361

Leave a Comment