Reputation: 217
I tried going through some of the other questions here at Stack, aswell as searching google but i mostly get hits in korean/japanese/chinese.
Anywho im running VS2010 its a MVC3 Project, im using a _layout masterpage using jQuery 1.4.4 along with a matching vsdoc for that version (downloaded today from MS so it should be the newest).
This is the content of the _layout page im using: http://pastebin.com/fB6FzaLS Not sure if its needed or not, but i added the code to enable the jQuery vsdoc (and the path is correct).
Whenever i Ctrl+Space the dot after the jQuery pointer i get this error in my output panel:
Javascript Intellisense Message: JSIntellisense:Internal/window(2:4) : Function expected
The intellisense suggestions it comes up with are extremely generic (constructor, valueof etc. about 7 ish in total)
In Extension manager i have disabled everything but the VisualStudio JScript enhancements (brackets, word highligther etc)
Any ideas what might be the problem here?
Upvotes: 5
Views: 2676
Reputation: 6792
I am also getting lots of
Javascript Intellisense Message :
I my output window when I try to validate my JavaScript in VS 2010 e.g.
Javascript Intellisense Message: [LocalPath]\jquery-1.5.1.js(6357:32) : Function expected
... etc and e.g.
: 'Sys' is undefined
: Object required
for files including
\jquery-1.5.1.js
\tiny_mce.js
and custom scripts files.
Wondering if people have any general advice on what sort of things can cause this?
And how to work out the root causes when you (like me) have a) checked all the obvious & easy bits, and b) have lots and lots of script files, and c) lots of references e.g.
/// <reference path="~/Scripts/custom/core.js" />
(in an attempt to get back the time you put into XML commenting your custom JS to pay off fully)
Upvotes: 1
Reputation: 6476
I'm wondering whether you're getting a conflict with the two instances of jQuery.
Two observations. Firstly, if all you're looking for is simple intellisense, VS2010 will do a very good job with the default jQuery reference. That said, I think your problem would be resolved by moving your JS into an external script file, and adding a reference to the VSDOC into that file instead.
Incidentally, jQuery 1.5.1 is out if you're looking for the most up to date version.
Rich
Upvotes: 3