如何在Visual Studio 2019中获取jQuery intellisense

编程入门 行业动态 更新时间:2024-10-26 06:38:04
本文介绍了如何在Visual Studio 2019中获取jQuery intellisense的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试让jQuery intellisense在Visual Studio中工作.

我正在使用最新的jQuery版本jquery-3.3.1.js和最新的Bootstrap v4.3.1.我已经尝试过Stack Overflow上的所有解决方案,但对我而言仍然没有任何效果.

我尝试引用 jquery-3.3.1.intellisense.js ,但没有任何反应.我还尝试安装jQuery类型的脚本,然后添加 jsconfig.json 并在其中引用jQuery类型的脚本,但不幸的是,再次没有发生任何事情.

要清楚一点,我希望在键入 $ 时可以使用智能感知.

解决方案

这对我有用:

  • 在我的解决方案中添加了一个Scripts文件夹,

  • 添加了文件"_references.js",

  • 在其中添加了我的参考声明到jQuery(我应该升级jQuery,呵呵):

    ///<参考路径="jquery-1.10.2.js"/>///<参考路径=" jquery-1.10.2.intellisense.js"/>

  • 关闭/重新打开我的解决方案并预先保存:

  • 这里有一些背景故事: www.madskristensen/blog/the-story-behind-_referencesjs/

    I am trying to get jQuery intellisense working in Visual Studio.

    I am using the latest jQuery version jquery-3.3.1.js and latest Bootstrap v4.3.1. I have tried every solution on Stack Overflow but nothing has yet worked for me.

    I tried to reference jquery-3.3.1.intellisense.js but nothing happened. I also tried installing jQuery typed script and then adding jsconfig.json and referencing the jQuery typed script in it but unfortunately again nothing happened.

    To be clear, I expect intellisense to work when I type $.

    解决方案

    This is what worked for me:

  • Added a Scripts folder to my solution,

  • Added a file '_references.js',

  • Added my reference statements to jQuery (I should upgrade jQuery, huh) in there:

    ///<reference path="jquery-1.10.2.js" /> ///<reference path="jquery-1.10.2.intellisense.js" />

  • Closed/Re-opened my solution and presto:

  • Here is some back story: www.madskristensen/blog/the-story-behind-_referencesjs/

    更多推荐

    如何在Visual Studio 2019中获取jQuery intellisense

    本文发布于:2023-11-17 14:02:39,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1610140.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何在   Visual   Studio   intellisense   jQuery

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!