Javascript _references.js 有什么用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10319645/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 00:50:35  来源:igfitidea点击:

What is the _references.js used for?

javascriptvisual-studioasp.net-mvc-4

提问by Todd Smith

What is the _references.js file used for in a new ASP.NET MVC 4 project?

新 ASP.NET MVC 4 项目中使用的 _references.js 文件是什么?

回答by Min Min

In VS 11, Visual Studio will give you intellisense from all files that have references in the “_references.js” file.

在 VS 11 中,Visual Studio 将为您提供所有在“_references.js”文件中有引用的文件的智能感知。

For More Info

更多信息

回答by Dmitry Pavlov

MSDN documentation: JavaScript IntelliSense

MSDN 文档:JavaScript IntelliSense

In brief, _references.js stores the list of JS files paths, for which you want the Visual Studio to gather and build the intelisense (aka "code complete"). The VS project adds there some common JS libraries like jQuery to build the intellisense for it. You can add a reference to your custom JS file in form like this:

简而言之,_references.js 存储 JS 文件路径的列表,您希望 Visual Studio 为其收集和构建智能感知(又名“代码完成”)。VS 项目在那里添加了一些常见的 JS 库,如 jQuery 来为其构建智能感知。您可以以如下形式添加对自定义 JS 文件的引用:

/// <reference path="MyScriptFile.js" />