How do you get JavaScript/jQuery Intellisense Working in Visual Studio 2008? How do you get JavaScript/jQuery Intellisense Working in Visual Studio 2008? asp.net asp.net

How do you get JavaScript/jQuery Intellisense Working in Visual Studio 2008?


At the top of your external JavaScript file, add the following:

/// <reference path="jQuery.js"/>

Make sure the path is correct, relative to the file's position in the folder structure, etc.

Also, any references need to be at the top of the file, before any other text, including comments - literally, the very first thing in the file. Hopefully future version of Visual Studio will work regardless of where it is in the file, or maybe they will do something altogether different...

Once you have done that and saved the file, hit Ctrl + Shift + J to force Visual Studio to update Intellisense.


There is an officially supported jQuery documentation JavaScript file for Visual Studio 2008. This file is only an interim fix until Microsoft releases a hotfix that will more adequately address the issue.

Embedded in ASPX:

<% if (false) { %>    <script src="jquery-1.2.6-vsdoc.js" type="text/javascript"></script><% } %>

Embedded in JavaScript:

/// <reference path="jquery-1.2.6-vsdoc.js" />

Pick it up here: jquery-1.2.6-vsdoc.js

References: