未捕获的TypeError:$(...)。modal

时间:2018-10-25 06:16:24

标签: php laravel forms bootstrap-modal laravel-5.7

  

为什么看不到模态?   和这样的错误

enter image description here

  

应该是这样

enter image description here

2 个答案:

答案 0 :(得分:1)

您应该尝试这种方式:

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<!-- BS JavaScript -->
<script type="text/javascript" src="js/bootstrap.js"></script>
<!-- Have fun using Bootstrap JS -->
<script type="text/javascript">
$(window).load(function() {
    $('#prizePopup').modal('show');
});
</script>

答案 1 :(得分:0)

答案

<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"> </script>
<script type="text/javascript" 
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript">
// jQuery
   $('.edit_real').on('click', function (event) {
       event.preventDefault();
       $('#edit_real').modal();
   });
</script>