Im a little bit confuse about firing a call back function in javascript modal of bootstrap3. In normal jquery.post you can do it like,
$.post(\
@Skelly is right, you can use the show.bs.modal event like this:
$('#myModal').on('show.bs.modal', function (e) {
alert('modal show');
});
The official documentation says:
This event fires immediately when the show instance method is called.
Please note that this event is fired "quite soon" and you may need to use shown.bs.modal instead.
Documentation about this event:
This event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete).
This impacts @Keith yeoh's answer and you should avoid timeouts when possible.
Source: Official Bootstrap documentation