views:

793

answers:

1

Hi,

I've been learning JQuery and I am writing my custom jquery codes in Custom.js file. Actually what I am trying to do is, activate intellisense for Jquery in visual studio but it's not working and I want intellisense to also work in custom.js file where actually I'm writing my custom logic and codes.

I thought it could be solved by reference jquery-1.3.2-vsdoc2.js in custom.js.

I've downloaded and installed update pack of jquery for visual studio 2008 on my computer.

So what should I do to activate intellisense.

Thanks in advance.

+12  A: 

First, when using Visual Studio 2008, install hotfix KB958502. Second, download the vsdoc file to the same folder as the original jQuery.js file, and make sure that file names match, i.e. if original file name is jquery-1.3.2.js, then the vsdoc file should be named jquery-1.3.2-vsdoc.js (notice: not vsdoc2.js); if you're using the min version of the file, adjust the name accordingly. Third, do not include the vsdoc file in the project (it's enough for the file to be in the same folder). Finally, to enable IntelliSense in custom JavaScript files, add the following line at the top of the JavaScript file (enter the correct path):

/// <reference path="path-to-vsdoc-file" />

Bonus: To refresh JavaScript IntelliSense, press Ctrl+Shift+J.

Alek Davis
Thanks,it's working with both visual web developer express and visual studio 2008.Thank you very much.
Braveyard
Don't know about VS 2008, but in VS 2010 I just need to drag the vsdoc file into the custom file and it adds something like /// <reference path="jquery-1.4.1-vsdoc.js" /> to the custom file.
Artur Carvalho