Skip to content

Instantly share code, notes, and snippets.

@amokan
Created November 13, 2009 15:55
Show Gist options
  • Save amokan/233920 to your computer and use it in GitHub Desktop.
Save amokan/233920 to your computer and use it in GitHub Desktop.
notes on setting up intellisense for jQuery in Visual Studio
http://www.learningjquery.com/2009/07/setting-up-visual-studio-intellisense-for-jquery
Download the files and add them to your project.
IntelliSense in external JavaScript files
At the top of the JavaScript file in which you would like to have jQuery IntelliSense enabled, you will need to add a line to reference the documentation file:
/// <reference path="jquery-1.3.2-vsdoc2.js" />IntelliSense inline on your ASPX page
There are a couple of scenarios that may affect if you include a reference to the VSDOC file or not. If in doubt, just add a reference to the documentation file.
If you are linking to jQuery by the Google Code AJAX Library or are linking to jQuery from anywhere outside of your project you will need to reference the documentation file.
From each ASPX page you want jQuery IntelliSense you’ll want to call the reference within a server-side conditional statement so that the documentation file will still load in Visual Studio but will not load at run-time. Add the following after your jQuery declaration:
///
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<% if (false) { %>
<script type="text/javascript" src="jquery-1.3.2-vsdoc2.js"></script>
<% } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment