Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to gain IntelliSense support via CDN, when JavaScript and VSDOC files are not local?

When I'm using the Google CDN to acquire the jQuery library, how do I then reference the companion Microsoft CDN VSDOC file to get IntelliSense support in VS 2010?

So far in documentation I've run across instructions to put the VSDOC file alongside the script file in the same folder (in the website) and abide by the naming convention.
e.g.

 /scripts/jquery-1.6.2-vsdoc.js  
 /scripts/jquery-1.6.2.js  

However my files aren't on disk. Can I gain IntelliSense over the network without downloading these files?

jQuery VS Doc location at Microsoft CDN:
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2-vsdoc.js

JQuery from Google CDN (with Google API key not shown):

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" 
    type="text/javascript">
</script>
like image 790
John K Avatar asked Jul 14 '11 04:07

John K


1 Answers

Yes, as long as the CDN has the -VSDOC file in the same location. Microsoft's CDN does, so just reference the js file from the CDN like this:

<!-- language-all: lang-html -->
<html>
  <head>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
    ...
  </head>
  <body>...</body>
</html>

Note: VS 2008 SP1 does not support this, so don't tear your hair out trying to get it to work!

Source: http://www.asp.net/ajaxlibrary/jquery_intellisense.ashx jump down to the section "Visual Studio 2010, IntelliSense and the CDN".

like image 120
K Lee Avatar answered Oct 28 '22 23:10

K Lee