Created
April 8, 2013 12:40
-
-
Save markovic131/5336510 to your computer and use it in GitHub Desktop.
When a link (or other element with href attribute) with class of "confirm-delete" is click, displays modal confirm dialog with Cancel/OK options. Clicking OK proceeds to the link location, Cancel closes the dialog. Dependencies: Bootbox.js (http://bootboxjs.com), Twitter Bootstrap, jQuery.
This file contains hidden or 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
$(document).on("click",".confirm-delete", function(e) { | |
bootbox.confirm("Sure you want to proceed?", function(result) { | |
if(result){window.location.href = e.target.href;} | |
}); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment