【问题标题】:plugin jQuery file from local Pc into Html file将本地PC中的jQuery文件插入Html文件
【发布时间】:2017-07-25 13:45:25
【问题描述】:

//jQuery文件和位置

<script src="C:/xampp/htdocs/AnasCourse/BootStarp/jQ.js"></script>

//这个我也试过了

<script type="text/javascript" src="file:///C:/xampp/htdocs/AnasCourse/BootStarp/jQ.js"></script>

// jQ.js 文件中的简单代码:

<script>
  $(document).ready(function(){
    $("p").hide();
  })
</script>

//控制台的结果是: 未捕获的 ReferenceError: $ 未定义

【问题讨论】:

  • 您不需要 JQ.js 文件中的脚本标签。而且您还需要在 html 中包含 jquery 库。
  • 1. 当我在 JQ 中编写脚本标签时以及当我将 jquery 库包含它的工作但基于我添加的库时,这是错误的。 2.我想要另一个jquery文件并在我需要的旁边进行修改。

标签: javascript jquery html jquery-plugins html5-canvas


【解决方案1】:
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>

我认为你没有先包含 jQuery 文件。

【讨论】:

  • 我做了,但我想要另一个 jQuery 文件并根据需要进行修改
  • 我没有得到你想要的东西。如果有任何冲突,请使用 noConflict。
  • 现在它成功了,非常感谢
猜你喜欢
  • 1970-01-01
  • 2020-03-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-28
  • 1970-01-01
  • 2016-07-15
  • 1970-01-01
相关资源
最近更新 更多