0
我遇到了一個模式問題,我有一個,當我關閉它時我需要運行一些東西,實際上當它關閉時,我需要刷新index.php。在模態隱藏時做些事
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min_2.1.4.js"></script>
<script src="js/bootstrap3.3.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" />
<script>
$('#myModal').modal({
'show': false
});
$('#btnModal').click(function() {
$('#myModal').modal('show');
});
$('#myModal').on('hide', function(e) {
if (!confirm('You want to close me?'))
e.preventDefault();
});
</script>
</head>
<body><!-- Button trigger modal -->
<button type="button" class="btn btn-success btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
<a role="button" class="btn" id="btnModal">Launch demo modal</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
</body>
</html>
我有這個例子,我不能這樣做的作品。有人可以幫助我嗎? THKS