我正在尝试使用 js 脚本,但它向我显示此错误未捕获引用错误:未定义 jQuery



实际上我正在使用一个模板,它包含了很多页面,所以我想使用其中一个所以我做了所有正确的事情,我猜,但它显示了我这个错误在控制台Uncaught ReferenceError: jQuery没有定义这是我唯一的HTML脚本

<script src="assets/js/pages/custom/wizard/wizard-1.js"></script>

我经常检查路径它是正确的路径我不知道在这些错误中该给你们提供什么这是我的index。html

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Gestion Commerciale</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="./assets/media/svg/illustrations/logo.png">
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700|Roboto:300,400,500,600,700"
rel="stylesheet">
<link href="assets/css/pages/wizard/wizard-1.css" rel="stylesheet" type="text/css" />
<!-- Splash Screen | Appears during application initialization proccess -->
<style>
body {
margin: 0;
padding: 0;
}
#splash-screen {
position: absolute;
z-index: 1000;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background-color: #f2f3f8;
}
#splash-screen img {
margin-left: calc(100vw - 100%);
margin-bottom: 30px;
}
#splash-screen.hidden {
opacity: 0;
visibility: hidden;
}
.splash-spinner {
animation: rotate 2s linear infinite;
margin-left: calc(100vw - 100%);
width: 50px;
height: 50px;
}
.splash-spinner .path {
stroke: #5d78ff;
stroke-linecap: round;
animation: dash 1.5s ease-in-out infinite;
}
@keyframes rotate {
100% {
transform: rotate(360deg);
}
}
@keyframes dash {
0% {
stroke-dasharray: 1, 150;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -35;
}
100% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -124;
}
}
</style>
</head>
<body root id="kt_body">
<div id="splash-screen">
<img src="./assets/media/svg/illustrations/logo.png" alt="Gestion-Commerciale-Logo" />
<svg class="splash-spinner" viewBox="0 0 50 50">
<circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle>
</svg>
</div>
</body>
<script src="assets/js/pages/custom/wizard/wizard-1.js"></script>
</html>

wizard-1.js可能依赖于jQuery。如果是这种情况,您需要在之前加载jQuery向导- 1. - js .

可以这样做:

<body root id="kt_body">
<div id="splash-screen">
<img src="./assets/media/svg/illustrations/logo.png" alt="Gestion-Commerciale-Logo" />
<svg class="splash-spinner" viewBox="0 0 50 50">
<circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle>
</svg>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="assets/js/pages/custom/wizard/wizard-1.js"></script>
</body>
另一个技巧,在body标签 的底部添加脚本标签

我猜你的库需要jquery,但你没有包括在你的Html试着添加这个:

<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>

相关内容

最新更新