当我使用 Google CDN 获取 jQuery 库时,如何引用配套的 Microsoft CDN VSDOC 文件以获得 VS 2010 中的 IntelliSense 支持?
到目前为止,在文档中,我已经了解了将 VSDOC 文件与脚本文件放在同一文件夹(在网站中)中并遵守命名约定的说明。
例如
/scripts/jquery-1.6.2-vsdoc.js
/scripts/jquery-1.6.2.js
但是我的文件不在磁盘上。 我可以在不下载这些文件的情况下通过网络获得 IntelliSense 吗?
jQuery VS Doc 在 Microsoft CDN 中的位置:
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2-vsdoc.js
来自 Google CDN 的 JQuery(未显示 Google API key ):
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"
type="text/javascript">
</script>
最佳答案
是的,只要 CDN 在同一位置具有 -VSDOC 文件即可。微软的CDN可以,所以只需从CDN引用js文件,如下所示:
<!-- 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>
注意: VS 2008 SP1 不支持这一点,所以不要费力尝试让它工作!
来源:http://www.asp.net/ajaxlibrary/jquery_intellisense.ashx跳至“Visual Studio 2010、IntelliSense 和 CDN”部分。
关于jquery - 当 JavaScript 和 VSDOC 文件不是本地时,如何通过 CDN 获得 IntelliSense 支持?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6688435/