You are here:Home » jquery » Enable jQuery Intellisense in Visual Studio 2010

Enable jQuery Intellisense in Visual Studio 2010

Enable jQuery Intellisense in Visual Studio 2010

How to Do That ?

There are 2 ways to do that.

Method 1 :

When you are working with Local copy of js files,Then you have to set up jquery-1.5.1-vsdoc.js file as below.(This is my js file version.It supports These versions )

Then on Master Page Set Script Tags like below.
<head>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
</head>

After that on Child Pages you can have Jquery Intellisense on each level of your code as below.



Method 2 :

If you are referring js files from CDN (Content Delivery Network) then add vsdoc.js file into your Scripts folder  like below.


Your Master Page should looks like below.
                                      with  Microsoft CDN 
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.1.min.js" type="text/javascript">
</script>
</head>
                                       with Google CDN

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript">
</script>
</head>


Note : If you set up vsdoc.js file as above then it works with both CDN.

Conclusion

By using above methods you can use jQuery Intellisense with VS 2010.One Very Important thing you have to remember here is both your .min.js file and .vsdoc.js files Versions Must be the Same.Otherwise some wrong Intellisense information may appear for Jquery functions.

0 comments:

Post a Comment