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

When I use Google CDN to purchase the jQuery library, how can I then link to the Microsoft CDN VSDOC file to get IntelliSense support in VS 2010?

So far in the documentation, I have followed the instructions to put the VSDOC file along with the script file in the same folder (on the website) and comply with the naming convention.
eg

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

However, my files are not on disk. Can I get IntelliSense over the network without downloading these files?

jQuery VS Doc location on 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> 
+6
source share
3 answers

Yes, if the CDN has the -VSDOC file in the same place. Microsoft CDN does, so just reference the js file from the CDN as follows:

 <!-- 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 not , so do not tear your hair trying to make it work!

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

+4
source

If you want vsdoc.js for jquery 1.6.2, then you can get it locally using the Nuget Package Manger in VS2010.

Go to VSTS2010 → Tools → Library Package Manager → Package Manager Console

In the package manager window, enter this command in the window

PM> Install JQStart Package

This will install the JQStart 1.0.4 package into the directory of your project, and you can go into the JQStart 1.0.4 folder and copy jquery-1.6.2-vsdoc.js from the script folder and use it in your script project.

Let me know if you have any confusion for the above procedure.

0
source

In VS2013, the only way to make this work is to copy the VSDOC locally, but still use the CDN for the actual script tag. Just drag and drop the vsdoc.js file (e.g. jquery-2.1.0-vsdoc.js) into your project and its intellisense will be added immediately. VS will even set its build action to None, so basically it will have no effect other than being on your local file system and providing intellisense (it will not be deployed anywhere).

If the library of your choice does not have a VSDOC file, you can still achieve partial intellisense by dragging the file itself into the project (for example, knockout-3.1.0.debug.js). If you do, be sure to set the build action to None manually (since VS will assume that you really want to use the file).

So basically drag any file you want for intellisense locally, provide the CDN link in your actual HTML code - at least the way everything works for me in VS2013 Update2 (websites installed).

0
source

Source: https://habr.com/ru/post/892726/


All Articles