views:

1581

answers:

4

I reference jQuery in my application via: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js.

This generates an error with vs.net: "Error updating JScript IntelliSense: c:...jquery.min-fds90[1]..js: Object doesn't support this property or method @18:9345.

Other than putting a local copy of the javascript file on my dev box, is there a way to fix this?

Btw, this occurs with VS.Net 2008 SP1 with this hotfix: http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx

A: 

I also encounter this problem.
This problem only occurs when you use minified version of jQuery.

You can use uncompressed version in development.

Billy
+1  A: 

I think the issue is that the vsdoc file on the jQuery site has a slightly incorrect filename which confuses VS.

See here:
http://patrickyong.net/2009/05/08/error-updating-jscript-intellisense-object-doesnt-support-this-property-or-method-21391/

tbone
Jim Geurts
+2  A: 

I finally found the answer to this question:

Basically, add the following to above your jQuery include:

<% /* %><script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2-vsdoc.js"&gt;&lt;/script&gt;&lt;% */ %>

Via: http://biasecurities.com/blog/2009/get-jquery-intellisense-in-vs-net-when-using-a-cdn/

Jim Geurts
I use this solution but instead of wrapping in /* and */ I use if (false) { }, which does the same thing but ReSharper doesn't complain about it. So, I use `<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>` and `<% if (false) { %><script src="../../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script><% } %>`. It works fine despite the minor version mismatch.
Chris
A: 

I found Rick Strahl's write up to be a really nice start to jQuery including his notes on setup for intellesense and visual studio

You can find his here.

Mark Schultheiss