Use of an implicitly declared global variable '$'

Hi,

ReSharper 6 is telling me that i should qualify the use of jQuery '$' shorthand (and everything else for that matter) with 'window'.

What's up with that?


Kenneth

0
7 comments
Avatar
Sergey Shkredov

Hi.


The reason for this warning is that R# can not find declaration of $ in your project. If you use ///<reference... annotation there may be problems with path to jQuery.js file (R# currently doesn't 'understand' paths starting with '~'). If you don't use reference annotations please make sure that jQuery files are included in the project (or any referenced project).
Thanks in advance for any information concerning your case.
0
Avatar
Permanently deleted user

I do have a reference to jQuery (through the google CDN). I'm working with a ASP.NET MVC 3 project, and my script references are declared in my layout page. Still there is no support for jQuery through ReSharper.
Shouldn't ReSharper support scripts from CDN's?


Kenneth

0
Avatar
Permanently deleted user

Hi,

I just tried disabling ReSharper and Visual Studio 2010 provides me with intellisense for jQuery. Why doesn't ReSharper do the same? :(

Kenneth

0
Avatar
Permanently deleted user

I had no problem with jquery references until I switched to using a CDN. Now I am getting the same issue that you report.

0
Avatar
Permanently deleted user

Is a fix or workaround for this being investigated? It seems that ReSharper doesn't understand jquery when it is loaded from a CDN!



Attachment(s):
shot1.png
0

Hi.
The only workaround I know is to download jQuery files and include them into the project locally.
Thanks.

0
Avatar
Permanently deleted user

Do you have any plans on fixing this in a future release? I guess I can use the "if false" hack explained here: http://stackoverflow.com/questions/5174554/asp-net-mvc-3-razor-jquery-intellisense

0

Please sign in to leave a comment.