(06-10-2019, 06:36 PM)hamanalda Wrote: Is the modal window called?
$('#myModal').on('show.bs.modal', function (event) {
console.log('myModal show~~~~~~~');
})
$('#myModal').modal();
If the call does not work
<script>
$(document).ready(function(){
function on_ready() {
$('#myModal').on('show.bs.modal', function (event) {
console.log('myModal show~~~~~~~');
})
$('#myModal').modal();
}
on_ready();
});
</script>
If called, Test it with the following code
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
https://getbootstrap.com/docs/3.4/javascript/#modals
Good luck~
Hello. Is it for me to test this code first? Without the <script> tag?
How to test this?
Code:
Is the modal window called?
$('#myModal').on('show.bs.modal', function (event) {
console.log('myModal show~~~~~~~');
})
$('#myModal').modal();
This second part is to be used along with html bootstrap below, ok?
Sorry, but I do not understand: the first code is for me to test how?
The first and second scrip JS are the same, correct?