views:

37

answers:

1

As the title says. If I include any other javascript file alongside jquery-1.4.1.js then intellisense for jQuery ceases to work. Any ideas why this happens? As always, I've had a good search around but without any luck, it should just work.

Cheers

A: 

Sometimes IntelliSense gets messed up by certain .js files. In general there's nothing you can do except removing the offending part of the source using trial-and-error.

At least in VS 2008 SP1 you can use the can use the -vsdoc.js "hack":

If you include other.js, also create an empty other-vsdoc.js in the same directory.

Visual Studio will then use this empty file for IntelliSense, so that whatever harms IntelliSense in the original other.js will no longer be active.

That way you'll don't have IntelliSense for other.js, but at least jQuery will work.

DR
You sir, are correct. Empty -vsdoc.js files associated with any other js includes are required. I wonder if MS knows about this issue?
Kezzer
Yes, they know: http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx. Though this is not required per se, only if you encounter .js files which break IntelliSense.
DR