gpt4 book ai didi

javascript - 未捕获的 TypeError : $(. ..).steps 不是函数

转载 作者:行者123 更新时间:2023-11-28 17:03:38 24 4
gpt4 key购买 nike

所以我在引导模板中看到了非常漂亮的表单,我想在我的项目中使用它们。

我放置了我认为需要导入的所有必需文件,这些文件添加在代码底部,所需文件位于正确的目录中,例如 jquery 步骤:C:\xampp\htdocs\rps\public\files\bower_components\jquery.steps\js\jquery.steps.js

'initialize-steps.js':

$("#practitioner-form").steps({
headerTag: "h3",
bodyTag: "fieldset",
transitionEffect: "slideLeft",
enablePagination: true,
autoFocus: true,
onFinished: function (event, currentIndex)
{
alert("Practitioner Added!");
}
});

我的带有多种形式 (...) 的 HTML 文件被跳过部分:

<div class="card-block">
<div class="row">
<div class="col-md-12">
<div id="practitioner-form">
<form method="post" id="practitioner-form" action="#">
<h3>Practitioner</h3>
<fieldset>
<legend>Practitioner Information</legend>
<div class="form-group row">
<div class="col-lg-12">
<label for="effective_date" class="block">{{trans('personalData.effectiveDate')}}</label>
</div>
<div class="col-lg-12">
<input id="effective_date" name="effectiveDate" type="date" class="form-control required">
</div>
</div>

(...)


<link rel="stylesheet" type="text/css" href="/files/bower_components/jquery.steps/css/jquery.steps.css">
<!-- Required Jquery -->
<script src="/files/js/views/person/initialize-steps.js"></script>
<script src="/files/bower_components/jquery/js/jquery.min.js"></script>
<script src="/files/bower_components/jquery-ui/js/jquery-ui.min.js"></script>
<script src="/files/bower_components/popper.js/js/popper.min.js"></script>
<script src="/files/bower_components/bootstrap/js/bootstrap.min.js"></script>
<!--Forms - Wizard js-->
<script src="/files/bower_components/jquery.cookie/js/jquery.cookie.js"></script>
<script src="/files/bower_components/jquery.steps/js/jquery.steps.js"></script>
<script src="/files/bower_components/jquery-validation/js/jquery.validate.js"></script>

<script src="/files/js/modules/practitionerCompetence.js"></script>

当我尝试加载页面时,我仍然收到错误:Uncaught TypeError: $(...).steps is not a function 有人知道如何修复它吗?

最佳答案

像这样将你的脚本放在最后的顺序 js

<script src="/files/bower_components/jquery/js/jquery.min.js"></script>
<script src="/files/bower_components/jquery-ui/js/jquery-ui.min.js"></script>
<script src="/files/bower_components/popper.js/js/popper.min.js"></script>
<script src="/files/bower_components/bootstrap/js/bootstrap.min.js"></script>
<!--Forms - Wizard js-->
<script src="/files/bower_components/jquery.cookie/js/jquery.cookie.js"></script>
<script src="/files/bower_components/jquery.steps/js/jquery.steps.js"></script>
<script src="/files/bower_components/jquery-validation/js/jquery.validate.js"></script>

<script src="/files/js/modules/practitionerCompetence.js"></script>
<script src="/files/js/views/person/initialize-steps.js"></script>

关于javascript - 未捕获的 TypeError : $(. ..).steps 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56560467/

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