简体   繁体   English

jQuery 智能感知无法在 Visual Studio 2015 上完全运行 mvc

[英]jQuery intellisense not working fully mvc on Visual Studio 2015

I have an MVC 5 application built off the Web application template.我有一个基于 Web 应用程序模板构建的 MVC 5 应用程序。 It is referencing jQuery 3.1.1 and the template uses the Bundler to reference everything from the shared layout page.它引用 jQuery 3.1.1,模板使用 Bundler 引用共享布局页面中的所有内容。

Just now starting to get into using jquery for some AJAX postbacks for filtering searching, etc. I see several examples across the web with刚刚开始使用 jquery 进行一些 AJAX 回传以进行过滤搜索等。我在网上看到了几个例子

$.ajax....

notation, but my intellisense does not list this as a valid item.符号,但我的智能感知没有将其列为有效项目。 All I see valid after $.所有我在$.之后看到的都是有效的$. are apply , arguments , attr , attrHooks , etc.applyargumentsattrattrHooks等。

I have tried the method with changing tools->options->javascript->intellisense to point to the local _references.js (which has the correct files referenced), but I still don't get anything that the jQuery API lists as valid methods.我已经尝试通过更改 tools->options->javascript->intellisense 指向本地_references.js (引用了正确的文件)的方法,但我仍然没有得到 jQuery API 列为有效方法的任何内容.

从 _references.js 中删除 jquery-ui-1.12.1.js 和 jquery-ui-1.12.1.js,它应该可以再次工作。

I was able to work around this by downgrading jquery to version 2.2.4 via NPM.我能够通过 NPM 将 jquery 降级到 2.2.4 版来解决这个问题。 Still no answer as to why, but this at least allows intellisense to function.仍然没有回答为什么,但这至少允许智能感知起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM