Simply drag-n-drop the jQuery library from Solution Explorer to the opened external JavaScript file.
The Intellisense should work now.
Make donation to this article:
Simply drag-n-drop the jQuery library from Solution Explorer to the opened external JavaScript file.
The Intellisense should work now.
Make donation to this article:
by
Tags:
[…] This post was mentioned on Twitter by Ferry Meidianto. Ferry Meidianto said: VS2010 Tips#7: How to make jQuery Intellisense work for external JavaScript file http://bit.ly/9RkQjm […]
HOLY CRAP SO SEXY
I can’t get over how easy this was. Thanks man!
My life just got a whole lot easier. Thanks!
Thanks a ton! I was really getting aggravated wihout my intellisense. It has really spoiled me.
Ferry – you saved my day! Thank you so much, man!
You’re welcome
not working on my pc.
would you pls help?
is there any patch that must be installed on vs2010?
No need to install a patch for VS2010 I believe. It was for VS2008.
Make sure that the JS is in your Project and drag it to the editor.
Nice one 😀
If someone has the same problem:
The line generated by the “magic drag drop”
/// reference path=../pathtofile.js
must be the first line of the js file, where you want to use intellinsense…
What about:
(function ($) {
test = function () {
};
})(jQuery);
is it working inside test function?
Thanks for the quick (but really useful) help!
[…] jQuery 1.4.1 Intellisense with Visual Studio VS2010 Tips #7: How to make jQuery Intellisense work for external JavaScript file Blog this! Bookmark on Delicious Digg this post Share on dzone Recommend on Facebook Share on […]
This doesn’t work for my 🙁 I was really hoping to get some jquery intellisense because we’re using this more and more.
Any ideas of what could be wrong in vs2010 professional sp1 ?
Try resetting your environment settings.
Tools -> Import and Export settings -> Reset all settings
@Frithjfo: Thank you!
The references must indeed be the very first lines of the document.
Perfect thanks. Just what I needed.
I had some problems dragging and dropping in the ide if anybody else have that problem you need to remember to “check” the option
tools > options > Text editor > general > Drag and drop editing
I think it’s “checked” by default, but I might have turned it off and then you cannot drag and drop like that.
Thanks Ferry and also Frithjfo! I also was unable to get this work until I stuck the /// at the top of my file, even before other comments. Works great now.
So, how do you keep these up to date as you upgrade your jQuery scripts to newer versions?
My thought is to modify the file names in my scripts folder to a “non versioned” number and make sure to update those files as I change my script references to new versions.
BOb
Genius, PilotBob. That’s just what I did. 🙂
For others who are having difficulty (like I was), as the FIRST line in your custom js file, add the following project RELATIVE reference link to your jQuery file.
///
As PilotBob mentioned, usinga generic name means not having to worry about update issues.
Just be sure to keep the version number intact in the jQuery file itself for eases of identification.
/*! jQuery v1.x.x http://jquery.com/ | http://jquery.org/license */
[…] […]
[…] VS2010 Tips #7: How to make jQuery Intellisense work for external JavaScript file […]
[…] VS2010 Tips #7 Share this:Like this:LikeBe the first to like this. Categories: Jquery Tags: enable jquery […]
This is amazing. Thanks for the tip!
Much needed tip for jquery..thanks a lot!!
This was amazingly simple. Thanks a ton!
[…] VS2010 Tips #7: How to make jQuery Intellisense work for outmost JavaScript file […]
Beautiful. Simple and elegant. Please put on up for VS 2015 as well..
Leave a Reply