【问题标题】:How to fix owl carousel problem with jQuery如何使用 jQuery 修复猫头鹰轮播问题
【发布时间】:2021-05-10 03:03:59
【问题描述】:

这是堆栈跟踪:

owl.carousel.min.js:6 Uncaught TypeError: Cannot read property 'fn' of undefined
  at owl.carousel.min.js:6
  at owl.carousel.min.js:6 (anonymous) @ owl.carousel.min.js:6 (anonymous) @ owl.carousel.min.js:6 index.js:1 Uncaught ReferenceError: $ is not defined
  at index.js:1

【问题讨论】:

  • 检查堆栈跟踪的底部...它表示您的页面中未包含 jQuery。 >> "$ is not defined"
  • 确保在任何与 jQuery 相关的脚本之前首先加载 jQuery。脚本自上而下加载。

标签: javascript html jquery css sass


【解决方案1】:

添加您的 html 的 head 部分以包含来自 Google 的 CDN 的 jQuery。一种快速验证缺少 jQuery 是否是问题根源的方法。

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

【讨论】:

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