Possible Duplicate:
Confirm delete modal/dialog with Twitter bootstrap?
How do I create a confirm delete dialog box using twitter’s boostrap framework?
I have a link that will do an ajax delete of an object on the backend, but I want to make sure the user confirms that they want to delete before I send the request.
I’m using jQuery on the front-end and node.js/express on the backend.
The jQuery code looks like this:
$("a.remove").click(function(e){
e.preventDefault();
$.ajax({
url: '/api/item/'+itemId,
type: 'DELETE',
success: function(d){
if ( d.status == 'success' ) {
app.msg({ type: 'info', msg: d.message, before: "#items" });
$("#item_"+itemId).fadeOut();
app.log('deleted');
} else {
app.msg({ type: 'error', msg: d.message, before: "#items" });
app.log('failed');
}
}
});
});
I want to inject a pretty confirmation box.
Please check this:
http://bootboxjs.com/