BlackFire27
BlackFire27

Reputation: 1550

intellisense with jquery in visual studio 2010

I put those two above. But I get no intellisense with jquery.

<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.5.1-vsdoc.js" type="text/javascript"></script>

I also want to achieve intellisense in a javascript file, is it possible?


UPDATE:

jQuery(function ($) {
    $("").   //no click event handler comes up
});

Upvotes: 13

Views: 10427

Answers (2)

Deepak Pathak
Deepak Pathak

Reputation: 646

Right click the project >> Click on 'Add Library Package Reference' >> On the left frame select 'Online' >> On the right most corner frame, enter 'jquery' in the 'Search Online' textbox >> After results come, click and Install the 'jQuery.vsdoc' package.

Simple!

Upvotes: 7

gdoron
gdoron

Reputation: 150253

Simple google search came up with this:

VS2010 Tips #7: How to make jQuery Intellisense work for external JavaScript file

Short answer:

/// <reference path="../../scripts/jquery-1.5.1-vsdoc.js"/>

Note that you can't use the @ sign inside js file like in a Asp.net-MVC View

Read this to learn how you can overcome this.

Upvotes: 19

Related Questions