Visual Studio中使用的JavaScript引用语法是什么? [英] What is this JavaScript reference syntax used in Visual Studio?
问题描述
在Visual Studio 2012中,我创建了一个Web应用程序,然后在项目附带的默认 _references.js 脚本中找到以下行:
In Visual Studio 2012, I created a web application then found the following line in the default _references.js script that came with the project:
/// <reference path="jquery-1.8.2.js" />
这个参考符号在做什么?这很令人困惑 - 这不仅仅是一个评论,它不应该做任何事情吗?据我所知,双斜杠(//)在JavaScript中注释掉一行。三条斜线评论有什么特别之处吗?
What is this reference notation doing? This is confusing - isn't this just a comment, which shouldn't do anything? As I understand, a double slash (//) comments out a line in JavaScript. Is there anything special about triple-slash comments?
推荐答案
参见这篇文章
http://msdn.microsoft.com/en-us/ library / vstudio / bb385682.aspx
并找到参考指令
引用指令使Visual Studio能够在您当前正在编辑的脚本与其他脚本之间建立关系。引用指令允许您在当前脚本文件的脚本上下文中包含脚本文件。这使IntelliSense能够在您编码时引用外部定义的函数,类型和字段。
A reference directive enables Visual Studio to establish a relationship between the script you are currently editing and other scripts. The reference directive lets you include a script file in the scripting context of the current script file. This enables IntelliSense to reference externally defined functions, types, and fields as you code.
这篇关于Visual Studio中使用的JavaScript引用语法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!