Created
September 13, 2012 17:39
-
-
Save mogetutu/3716100 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML code: | |
<div id="myModal" class="modal hide fade"> | |
<div class="modal-header"> | |
<button class="close" data-dismiss="modal">×</button> | |
<h3>Title</h3> | |
</div> | |
<div class="modal-body"> | |
<div id="modalContent" style="display:none;"> | |
</div> | |
</div> | |
<div class="modal-footer"> | |
<a href="#" class="btn btn-info" data-dismiss="modal" >Close</a> | |
</div> | |
</div> | |
jQuery code: | |
$("a[data-toggle=modal]").click(function() | |
{ | |
var essay_id = $(this).attr('id'); | |
$.ajax({ | |
cache: false, | |
type: 'POST', | |
url: 'backend.php', | |
data: 'EID='+essay_id, | |
success: function(data) | |
{ | |
$('#myModal').show(); | |
$('#modalContent').show().html(data); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment