我引入头文件的方式:
$.get("header.html",function (data) {
$("#header").html(data);
});
点击按钮后触发静态框:
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
静态框:
<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">
<h4 class="modal-title" id="myModalLabel">
模态框(Modal)标题
</h4>
</div>
<form id="form_data">
<div class="modal-body">
user_id: <input type="text" id="user_id" name="user_id"/>
name: <input type="text" id="user_name" name="user_name"/>
<input type="hidden" id="act" value="add" name="act"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary">
提交更改
</button>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>