问题描述
我在看似最简单的操作方面遇到了一些困难。
I'm having some difficulty with what seems to be the simplest of operations.
在visual studio中,当我将vsDoc从1.4.1更改为1.5时,javascript在页面上不再有效。 (Visual Studio 2010)
In visual studio, when I change vsDoc from 1.4.1 to 1.5, javascript on the page no longer works. (Visual Studio 2010)
原始(有效)如下:
<head runat="server">
<title></title>
<link type="text/css" href="css/excite-bike/jquery-ui-1.8.11.custom.css" rel="stylesheet" />
<script src="Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
一切都很好,intellisense很好,javascript很好。一切都很好。
And everything is fine, intellisense is fine, javascript is fine. Everything is good to go.
然而,当我引用较新的vsDoc文件时(从)
However, when I reference the newer vsDoc file (obtained from ajax.aspnetcdn.com )
<head runat="server">
<title></title>
<link type="text/css" href="css/excite-bike/jquery-ui-1.8.11.custom.css" rel="stylesheet" />
<script src="Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.5-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
页面无法正确加载,firebug显示以下错误:
The page doesn't load properly and firebug shows the following errors:
class2type is not defined
rootjQuery is not defined
这两个错误显然源于vsdoc文件行67
Both errors are apparently stemming from the vsdoc file line 67
我觉得我错过了一些非常明显的东西,我希望有人可以填写我在。
I feel like I'm missing something terribly obvious and I hope someone can fill me in.
谢谢!
推荐答案
-vsdoc
不打算包含在您的实际页面中,只是在您需要智能感知的文件中。为了您的使用,只需重命名:
The -vsdoc
is not intended to be included in your actual page, just in the files you need intellisense in. For your use, just rename:
Scripts/jquery-1.5-vsdoc.js
to
Scripts/jquery-1.5.1-vsdoc.js
然后删除 -vsdoc.js
< ;脚本>
从页面中阻止。 Visual Studio将自动搜索您包含的任何本地JavaScript文件的 -vsdoc.js
。它不需要明确地包含在页面中......这实际上会导致你看到的问题,因为它定义了相同的空函数(而不是所有需要的变量)。
and then remove that -vsdoc.js
<script>
block from the page. Visual studio will automatically search for the -vsdoc.js
of any local JavaScript file you're including default. It need not be included in the page explicitly...that'll actually lead to issues like you're seeing, since it defines the same empty functions (and not all the needed variables).
这篇关于将vsDoc更新为1.5会破坏所有javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!