Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I thought jQuery Intellisense was supposed to be improved with SP1. I even downloaded an annotated version of jQuery 1.2.6, but intellisense will not work in a separate jscript file. I have the jQuery library referenced first on my web page in the <head> tag. Am I doing anything wrong?

like image 745
Mark Struzinski Avatar asked Sep 12 '08 19:09

Mark Struzinski


People also ask

What is JavaScript IntelliSense?

IntelliSense# Visual Studio Code's JavaScript IntelliSense provides intelligent code completion, parameter info, references search, and many other advanced language features.


1 Answers

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.

like image 191
Jason Bunting Avatar answered Oct 04 '22 19:10

Jason Bunting