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
Please sign in to leave a comment.
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.
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
Hi,
I just tried disabling ReSharper and Visual Studio 2010 provides me with intellisense for jQuery. Why doesn't ReSharper do the same? :(
Kenneth
I had no problem with jquery references until I switched to using a CDN. Now I am getting the same issue that you report.
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
Hi.
The only workaround I know is to download jQuery files and include them into the project locally.
Thanks.
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