【发布时间】:2021-07-16 08:52:55
【问题描述】:
我正在使用 parsley Js 但不幸的是它不起作用请帮助我如何解决这个问题。谢谢。
控制台错误
jquery-3.6.0.min.js:2 jQuery.Deferred 异常:$(...).parsley 不是函数 TypeError: $(...).parsley 不是函数 在 HTML 文档。 (http://localhost/permit-to-work/cms/public/branch/add:313:14) 在 e (https://code.jquery.com/jquery-3.6.0.min.js:2:30038) 在 t (https://code.jquery.com/jquery-3.6.0.min.js:2:30340) 未定义
html 视图
<form class="form" action="{{$isEdit ? route('branch.update', [$branchs->id]) : route('branch.store')}}" method="post" autocomplete="off" >
@csrf
<input type="text" name="name" value="{{$branchs->name ?? old('name') ?? null}}" parsley-trigger="change" placeholder="Name..." class="form-control" required>
</form>
脚本
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="{{url('')}}/plugins/parsleyjs/parsley.min.js"></script>
<script>
jQuery(document).ready(function () {
$('.form').parsley();
});
</script>
【问题讨论】:
标签: jquery parsley.js