Visual Studio 10, JavaScript intellisense inside javascript.js file, and where is the MicrosoftAjax-vsdoc.js

StackOverflow https://stackoverflow.com/questions/3266006

  •  16-09-2020
  •  | 
  •  

Domanda

I can get javascript intellisense going from and aspx or master page ie

<script src="../../Scripts/jquery-1.4.1-vsdoc.js"type="text/javascript"></script>  
<script type="text/javascript">
    $.isFunction( 
</script>  

gives me a drop down in vs2010.

I do all(most) of my js coding inside a js file. How do I get intellisense drop downs inside js files ?

Also, is there a vsdoc for ms ajax (MicrosoftAjax-vsdoc.js) ?

È stato utile?

Soluzione

At the top of your .js file add this:

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

Or make the path relative, if it's not in the same directory, it'll look for the jquery-1.4.1-vsdoc.js when grabbing it for intellisense, any file you reference like this it'll look for the -vsdoc version if available. As a side note, jQuery 1.4.2 has additional bug fixes you should consider upgrading :)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top