问题描述
我已经全新安装了Visual Studio 2012 Web Developer Express,并且由于某种原因对JavaScript(jQuery,jQuery UI和其他库)的支持已经消失.我相信它之前曾奏效,然后无故"停止了.
I have a clean, out-of-the-box installation of Visual Studio 2012 Web Developer Express and for some reason the support for JavaScript (both jQuery, jQuery UI and other libraries) has disappeared. I believe it worked before and then for "no reason" it stopped.
我已经按照预期浏览了网络,发现了四个差异.
I've browsed the web as supposed to and discovered four discrepancies.
-
我的注册表中没有注册表项HKEY_CURRENT_USER \ Software \ Microsoft \ VisualStudio \ 11.0 \ JavaScriptLanguageService \ ImplicitReferences.实际上,我什至没有JavaScriptLanguageService目录.
I don't have the key HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\JavaScriptLanguageService\ImplicitReferences in my registry. In fact, I don't even have JavaScriptLanguageService directory.
我检查了所引用文件domWindows.js的确是选项所指向的位置.
I've checked that the referred file domWindows.js indeed is where the options point to.
JavaScriptLanguageService下的输出窗口为空,并且在我开发和运行应用程序时未在其中键入任何内容.
The output window under JavaScriptLanguageService is empty and nothing is being typed there while I develop and run my application.
我已经通过选项引用了我正在使用的jQuery文件,但是它没有产生任何变化.
I've referred to the jQuery-file that I'm using through the options but it didn't produce any changes.
总而言之,我收到以下错误消息:
All in all I get the error message saying that:
任何建议将不胜感激.
推荐答案
对
摘要:
-
导航至[工具]> [选项]>文本编辑器> JavaScript> IntelliSense>引用选项
navigate to the [Tools] > [Options] > Text Editor > JavaScript > IntelliSense > References options
选择隐式(网络)
您可以找到〜/Scripts/_references.js"(如果您想将其放在其他位置,请在此处进行更改)
you can find "~/Scripts/_references.js"(if you want to put it in different place, change it here)
转到〜/Scripts并添加新项目"_references.js"
go to ~/Scripts and add new item "_references.js"
在"_references.js"中添加/// <reference path="path\jquery-1.7.1.js" />
add /// <reference path="path\jquery-1.7.1.js" />
in "_references.js"
或/// <reference path="~\root\path\jquery-1.7.1.js" />
快乐编码:)
编辑笔记:
请记住将jquery-1.7.1-vsdoc.js与jquery-1.7.1.js放在同一文件夹中
Remember to put jquery-1.7.1-vsdoc.js in the same folder with jquery-1.7.1.js
进行上述更改后,如果仍然无法正常运行,请尝试重新启动Visual Studio.
After making above mentioned changes, if it is still not working try restarting visual studio.
这篇关于Intellisense在Visual Studio 2012中不适用于JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!