I tried to create modal window using Twitter Bootstrap with the following code
<link rel= "stylesheet" href = "/static/bootstrap/css/bootstrap.css" >
<script src ="/static/bootstrap/js/bootstrap-modal.js" ></script>
<script type = "text/javascript" src= "/static/bootstrap/js/bootstrap.js" ></script>
<script src="/static/js/jquery.js></script>
<div class="modal hide" id="myModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close </a>
<a href="#" class="btn btn-primary"> Save changes </a>
</div>
</div>
<a class="btn" data-toggle="modal" href="#myModal"> Launch Modal </a>
But it still only shows one button. I click on the link and nothing happens, the modal window does not pop up. Please help me find out what I’m doing wrong?
P.S I just started learning it now. If you could please tell me where is my error is that would be great.
You’re loading your
bootstrap.jsafterbootstrap-modal.js.As well, It’s better to move them to the very end of
<body>.