Visual Studio Javascript / jQuery intellisense has stopped working

For some reason my jQuery / Javascript intellisense stops working in Visual Studio. I'm not sure what change caused this to "break". I've already gone through and reset all Visual Studio settings. vsdoc is included in the file Site.Master

. Not sure why this doesn't work.

<script src="<%= Url.Content("~/Scripts/jQuery/jquery-1.4.1-vsdoc.js") %>" type="text/javascript"></script>

      

Here is an example of what I get when trying to use intellisense. These are the only options I ALWAYS have.

Intellisense not working.

+3


source to share


3 answers


I found the problem. I had vsdoc

to enable jQuery intellisense, however using the helper made it not work:

<script src="<%= Url.Content("~/Scripts/jquery/jquery-1.7.1-vsdoc.js") %>">
</script>

      

Easily fixed by referencing the file like this:



<script src="../../Scripts/jQuery/jquery-1.7.1-vsdoc.js">
</script>

      

This is similar to CSS intellisense as well.

+1


source


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

      



attach the above code in the first line of your js file then you will get intellisense.

0


source


Include the actual jquery file, not the -vsdoc extras:

<script src="~/Scripts/jquery/jquery-1.7.1.js"></script>

      

Visual Studio automatically looks for -vsdoc when initializing Intellisense. Try to separate jquery and jquery-1.7.1-vsdoc to see what I mean - you will notice that the -vsdoc file is missing most of the jquery and has a lot of classes and functions listed that you don't really need to specify for jquery to works - but they have to be written for Microsoft Intellisense to figure it out. The -vsdoc.js files are specially handled by Visual Studio. You may also notice that when you add it to a project, Visual Studio automatically sets its build action to None instead of Copy, so they will not be expanded upon publish. As they only exist as an additional Visual Studio Info.

0


source







All Articles