Asked by: Sara
I'm using Materialize css library and laravel to create a Survey application: here is my html code:
<div id="doDelete" class="modal bottom-sheet">
<div class="modal-content">
<div class="container">
<div class="row">
<h4>Are you sure?</h4>
<p>Do you wish to delete this survey called "{{ $survey->title }}"?</p>
<div class="modal-footer">
<a href="/survey/{{ $survey->id }}/delete" class=" modal-action waves-effect waves-light btn-flat red-text">Yep yep!</a>
<a class=" modal-action modal-close waves-effect waves-light green white-text btn">No, stop!</a>
</div>
</div>
</div>
</div>
</div>
and init.js code:
$(document).ready(function() {
$('.collapsible').collapsible({
accordion: false
});
$('.modal-trigger').leanModal();
$(document).on('click', '.delete-option', function() {
$(this).parent(".input-field").remove();
});
but I have this error when trying to execute delete function
init.js:6 Uncaught TypeError: $(...).leanModal is not a function
at HTMLDocument.<anonymous> (init.js:6)
at j (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at Function.ready (jquery.min.js:2)
at HTMLDocument.I (jquery.min.js:2)
also I include init.js and jquery.min.js
<script src="{{ URL::asset('jquery.min.js') }}"></script>
{!! MaterializeCSS::include_js() !!}
<script src="{{ URL::asset('init.js') }}"></script>
any help please !! thanks.
No comments:
Post a Comment