Home » Configuration | Visual Studio | jQuery

IntelliSense for jQuery in Visual Studio

10. March 2010 by Daniel Berg 0 Comments

IntelliSense for jQuery in web forms

To enable IntelliSense for jQuey in a web form all you need to do is to reference the jQuery and Visual Studio will automatically enable IntelliSense for you. As seen in the image below I reference jQuery from a local file path and Visual Studio enables IntelliSense for me.

image

Just referencing the jQuery library file offers basic IntelliSense. As seen here.

 image 

In order to enable a richer experience you’ll need to add the Visual Studio documentation .js-file to your project. It’s important that it’s named with the same version as your jQuery library.

image

Having done this  you’ll have a richer IntelliSense for jQuery.

image

Note: if the vsdoc-file is in the same directory as your jQuery-library then adding the <script>-tag for the documentation isn’t necessary. Visual Studio will automatically discover it for you.  Also, do not ship the vsdoc-file into production. It is only meant for design-time.

IntelliSense in external js-files

To enable IntelliSense for jQuery in external js-files you’ll need to add a reference to the jQuery-library itself. Like the previous example you only need to add a reference to the vsdoc-file if it is placed in another folder than your jQuery-library. Otherwise Visual Studio will automatically discover it.

image

Download

Download the jQuery-library and Visual Studio documentation files from here.

Add comment


(Will show your Gravatar icon)

  Country flag


  • Comment
  • Preview
Loading