This post is for all WebDevs that use Visual Studio as web development tool.
Who never needed to develop something using jQuery and questioned yourself why Visual Studio Intellisense doesn’t work for jQuery?
Sometimes we make small mistakes while developing with jQuery, and those little mistakes makes you remember that if we had intellisense we might not do some errors, or even think that if we had intellisense we could know which functions jQuery have. Well, I will give a tip that can help on this question.
I will use Visual Studio 2010 and jQuery to demonstrate how to use Visual Studio intellisense for jQuery codes.
Let’s do it!
Now on my Suzuki.js file, we will create our jQuery code. If we simply try to call the ready function, we can see that intellisense doesn’t show this function.
To activate the intellisense for jQuery, we need to drag and drop the jquery-1.7.2.js file from our solution explorer inside our file Suzuki.js (open file). Once you have done that you will see that Visual Studio will create the following command.
/// <reference path="jQuery/jquery-1.7.2.js" />
Done! Now we have intellisense for jQuery working on our Visual Studio for this file (Suzuki.js specifically).
Now if we try to use the ready function again we will see the function on intellisense:
You can get jQuery on this link – http://jquery.com.
Thanks for reading.
Like and Share if you found it may be useful to someone you know!