我也尝试过使用Uncaught TypeError: $(...).modal is not a function
jQuery
,但仍然得到相同类型的错误:
我已经多次搜索并尝试了不同的解决方案,但都没有成功。Uncaught TypeError: jQuery(...).modal is not a function
以下是我的脚本:
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript">
$(window).on('load',function(){
$('#loadModal').modal('show');
});
</script>
这是我的模态框
<div class="modal hide fade" id="loadModal">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<a href="#" class="btn">Close</a>
<a href="#" class="btn btn-primary">Save changes</a>
</div>
</div>
bootstrap.min.js
已经在您的计算机上加载了。打开开发者工具 (F12
) 并转到网络选项卡
,然后单击禁用缓存
并按下刷新 (F5
)。 - Ritwick Deyhttp://code.jquery.com/jquery-1.11.0.min.js
不是。将该文件保存在服务器本地并从那里引用。 - techie_28