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:
3. Once this is in place a simple test of function was created and Intellisense was tested:
The reference to jQuery can be clearly seen here.
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.
RE: Getting jQuery Intellisense Functioning in Visual Studio 2008
Pingback from ASP.NET MVC Archived Blog Posts, Page 1
RE: Getting jQuery Intellisense Functioning in Visual Studio 2008
Pingback from ASP.NET MVC Archived Blog Posts, Page 1
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!
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!
@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.
@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.
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?
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?
thank you!
thank you!