Can I use the content delivery network for Intellisense in Visual Studio 2008?

As I understand this , you should be able to (with KB958502 ) get Intellisense for jQuery by simply specifying a script (as long as the -vsdoc version exists).

We would like to use the CDN to distribute this, but just add:

<script language="javascript" type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.js"></script> 

Gives a vague warning

Warning 1 Error updating JScript IntelliSense: C: ... \ Temporary Internet Files \ Content.IE5 \ 4U5FWPZF \ jquery-1.7.1-fds90 1 ..js: the object does not support this property or @ 1352: 1 method c: \ Projects ... \ MyFile.aspx

Under the assumption, I assume that it "has sulk" because the file name in the cache does not have the form jquery-1.7.1-vsdoc.js, especially since the error remains unchanged even if I go all the way with:

 <script language="javascript" type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.js"></script> <script language="javascript" type="text/javascript"> // This is for jQuery intelisense: /// <reference path="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1-vsdoc.js"/> $(function() { // My other code... }); </script> 

This still does not work.

Is this just the case when vsdoc Intellisense doesn't work with remotely hosted files?

+4
source share
3 answers

I don’t think it is possible, at least without any third-party tools or complex hacks (I don’t know anything). What I've always done in the past is loading jquery and from your js files you can add

  /// <reference path="Scripts/jquery.js"/> 

for intellisense, but on your pages, get the library from the CDN. Just because the script link is provided in your js, this does not make the bootloader a browser, so you will get the script from cdn at startup.

+1
source

In any case, you really should have a local jQuery backup, otherwise, if there is any problem with the CDN, people can get to your page, but it fails because it cannot load from the CDN.

If you have a local copy, it will work. A CDN simply does not allow users to download a new copy when they first appear on your site, if they were on another site that also uses the same CDN.

0
source

This works for me. I have fully fixed on Win7 x64. It takes a few seconds for VS to download and parse the script file after the first time $ entered, but it works and it works well.

Edit: Now I seem to be getting an error, but sporadically. Have you tried updating the Intellisense cache with Shift+Ctrl+J ?

0
source

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


All Articles