未捕获的TypeError:$(...).steps不是函数 [英] Uncaught TypeError: $(...).steps is not a function

查看:68
本文介绍了未捕获的TypeError:$(...).steps不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

So I saw really good looking forms in my bootstrap template and I wanted to use them in my project.

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

I placed all the required files that I think we need to import which are added at the bottom of the code, required files are in the correct directories, for example, jquery steps: C:\xampp\htdocs\rps\public\files\bower_components\jquery.steps\js\jquery.steps.js

'initialize-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文件被跳过了一部分:

My HTML file with multiform (...) is skipped part:

<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>

在尝试加载页面时仍然出现错误:未捕获的TypeError:$(...).steps不是函数任何人都知道如何修复它?

Still when I try to load up the page I get an error: Uncaught TypeError: $(...).steps is not a function Anyone knows how to fix it?

推荐答案

jquery.steps.js initialize-steps.js

<script src="/files/js/views/person/initialize-steps.js"></script>
....
<script src="/files/bower_components/jquery.steps/js/jquery.steps.js"></script>

您需要在之后加载 initialize-steps.js

You need to load initialize-steps.js after it

<script src="/files/bower_components/jquery.steps/js/jquery.steps.js"></script>
<script src="/files/js/views/person/initialize-steps.js"></script>
....

这篇关于未捕获的TypeError:$(...).steps不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆