I recently heard about this technique to get jQuery intellisense working in Visual Studio .Net. jQuery intellisense traditionally has never worked properly for me because I don’t use <head runat="server"> and thus don’t link to javascript files the MS way. Most of the sites I build today just reference jQuery on a CDN like Google or Microsoft and that breaks Visual Studio’s ability to find the associated vsdoc.js file. This works, however:
Add the following line to your master page file in the <head> element area under your normal jQuery script tag.
That line wraps the script tag in comments, so the script tag never gets rendered on the client side. Visual Studio sees a valid file, though, and provides intellisense based off the comments in that file. Below is a full example page layout:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example jQuery Intellisense</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<% /* %><script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2-vsdoc.js"></script><% */ %>
<!– Add your own javascript here –>
</head>
<body>
Do work son
</body>
</html>
RE: Get jQuery intellisense in VS.Net when using a CDN
You’ve been kicked (a good thing) – Trackback from DotNetKicks.com