How to make jQuery Visual Studio 2010 IntelliSense work inside the noconflict shell

I added jQuery vsdoc link to js file:

/// <reference path="../jquery-1.4.1.vsdoc.js" /> 

This works fine, but as soon as I write inside the shell without conflicts ...

 (function ($) { ...here... })(jQuery); 

... IntelliSense is not working.

Why is this, and is there a way to solve this?

+4
source share
6 answers

Try adding the <param / "> tag at the beginning of your wrapper function:

 /// <reference path="../jquery-1.4.1.vsdoc.js" /> (function($) { /// <param name="$" type="jQuery" /> ... })(jQuery); 
+10
source

For Visual Studio 2008, when I write

 /// <reference path="../jquery-1.4.1.vsdoc.js" /> <intellisense works here> (function ($) { /// <param name="$" type="jQuery" /> <intellisense doesn't work here> })(jQuery); 

Does uhleeka help work in VS2010, and not in 2008? Was the upgrade to 2010 a modified setting?

Edit: I have to clarify that this works inside the no shell, but not completely. Outside of the wrapper, I can intellisense $ .getJSON, inside I cannot. Outside, after closing my selector (for example, $ ('# test'), a list appears starting with _load, inside the wrapper there is no list after closing the selector. Just a few examples of different behavior.

Does anyone have any recommendations regarding compatibility with no conflicting shells?

+1
source
 /// <reference path="../jquery-1.4.1.js" /> 
0
source

If you work with jQuery () instead of $ (), intellisense works without problems.

 jQuery("#con").click .... var element = jQuery(this).... 
0
source

Make sure your jquery intellisense link files are the first elements of your script file.

If you have a comment in front of your link bar, it will not work, as in

File: nonsense **

Do it File: "nonsense

0
source

use /// <param name="$" type="jQuery" /> in the closure as the first line.

It worked for me in Visual Studio 2010 SP1.

0
source

All Articles