gpt4 book ai didi

javascript - 引导设置错误 : Uncaught ReferenceError: jQuery is not defined & Uncaught Error: Bootstrap's JavaScript requires jQuery

转载 作者:行者123 更新时间:2023-11-30 12:11:15 28 4
gpt4 key购买 nike

我正在创建 Bootstrap 模板。我收到两个错误,我不知道自己做错了什么。当我搜索类似的问题时,似乎是脚本错乱了,但我认为它们的位置是正确的。

两个错误:

未捕获的 ReferenceError: jQuery 未定义

Uncaught Error :Bootstrap 的 JavaScript 需要 jQuery

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">

<!--IE Edge meta Tag-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<!--Viewport-->
<meta name="viewport" content="width=device-width, initial-scale=1">

<!--Minified Bootstrap CSS from MaxCDN-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">

<link rel="stylesheet" type="text/css" href="css/custom.css">

<title>Bootstrap 3.3.5</title>
<meta name="keywords" content="keywords, go, here">
<meta name="description" content="meta description goes here">
</head>

<body>
<h1>header</h1>
<p>Lorem ipsum dolor sit amet, an numquam platonem abhorreant mea, nec at eripuit tincidunt accommodare. Ut sit utinam ridens commune. Nec ad stet utroque periculis. Eu eum errem assueverit. Ius vitae definitionem ea.</p>

<!--jquery CDN-->
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>

<!-- Bootstrap's JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>

<!--link to local js file-->
<script type="text/javascript" src="js/script.js"></script>
</body>
</html>

最佳答案

伙计,你应该链接 jQuery lib 而不是 jQuery UI )

只需添加这段代码

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

从这里得到:https://developers.google.com/speed/libraries/

关于javascript - 引导设置错误 : Uncaught ReferenceError: jQuery is not defined & Uncaught Error: Bootstrap's JavaScript requires jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33738360/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com