How to 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 )

Local copy of js files

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.

Jquery Intellisense


Method 2 :

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

CDN (Content Delivery Network)

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.

Happy Coding.

May Be Use Full To You :
How to Disable a Button Using Jquery and CSS ?
How to Convert Linq Entity Query into T-SQL ?
How to Improve Performance of Entity Framework Query (over 400 times)?

Related Posts by Categories

0 comments:

Post a Comment

Blog Archive

Powered by Blogger.