【问题标题】:Trying to use datepicker with jquery CDN尝试将 datepicker 与 jquery CDN 一起使用
【发布时间】:2016-08-01 17:08:58
【问题描述】:

我正在尝试使用 jQuery 提供的 CDN 使用 jQuery UI 中的日期选择器,我在 Google Chrome 中遇到这些错误,我想知道原因。

jquery-ui.js:14 未捕获的 ReferenceError:未定义 jQuery(匿名函数)

未捕获的 ReferenceError: $ 未定义

 <!DOCTYPE html>
    <html>
      <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js" integrity="sha256-0YPKAwZP7Mp3ALMRVB2i8GXeEndvCq3eSl/WsAl1Ryk="   crossorigin="anonymous"></script>
    </head>
...

【问题讨论】:

  • 你必须在 jQuery UI 之前包含 jQuery。
  • @APAD1:为什么不将其发布为答案。

标签: jquery


【解决方案1】:

正如@APAD1 所说,jQuery UI 需要 jQuery。

<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>

之前

<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js" integrity="sha256-0YPKAwZP7Mp3ALMRVB2i8GXeEndvCq3eSl/WsAl1Ryk="   crossorigin="anonymous"></script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多