如何让 bootstrap 模态工作?
How do I get bootstrap modal working?
下面是html
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="styles/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"
href="styles/bootstrap-theme.min.css" />
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascipt" src="js/bootstrap.min.js"></script>
</head>
<body>
<button type="button" class="btn btn-primary btn-lg"
data-toggle="modal" data-target="#myModal">Launch demo modal
</button>
<!-- Modal for file filter -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<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-primary">Apply</button>
</div>
</div>
</div>
</div>
</body>
</html>
我已经查找了同一问题的答案。相同的解决方案建议在 bootstrap.js 之前加载 jquery.js。我的不工作尽管照顾相同。
编辑
我现在使用 bootstrap-3.3.4 和 jquery-2.1.3
删除
type="text/javascipt"
来自 bootstrap.min.js 脚本。
下面是html
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="styles/bootstrap.min.css" />
<link rel="stylesheet" type="text/css"
href="styles/bootstrap-theme.min.css" />
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascipt" src="js/bootstrap.min.js"></script>
</head>
<body>
<button type="button" class="btn btn-primary btn-lg"
data-toggle="modal" data-target="#myModal">Launch demo modal
</button>
<!-- Modal for file filter -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<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-primary">Apply</button>
</div>
</div>
</div>
</div>
</body>
</html>
我已经查找了同一问题的答案。相同的解决方案建议在 bootstrap.js 之前加载 jquery.js。我的不工作尽管照顾相同。
编辑 我现在使用 bootstrap-3.3.4 和 jquery-2.1.3
删除
type="text/javascipt"
来自 bootstrap.min.js 脚本。