Skip to content

Instantly share code, notes, and snippets.

@makeusabrew
Last active August 21, 2016 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save makeusabrew/6327301 to your computer and use it in GitHub Desktop.
Save makeusabrew/6327301 to your computer and use it in GitHub Desktop.
bootbox.dialog({
message: "I am a custom dialog",
title: "Custom title",
buttons: {
success: {
label: "Success!",
className: "btn-success",
callback: function() {
Example.show("great success");
}
},
danger: {
label: "Danger!",
className: "btn-danger",
callback: function() {
Example.show("uh oh, look out!");
}
},
main: {
label: "Click ME!",
className: "btn-primary",
callback: function() {
Example.show("Primary button");
}
}
}
});
@tuesdaywasalreadytaken
Copy link

I'm trying to the life of me to make this work but cannot do it.

The original code is :

<script src="js/bootbox.js"></script>
<script>
    $(document).on("click", ".alert", function(e) {
        bootbox.alert("Hello world!", function() {
            console.log("Alert Callback");
        });
    });
</script>

I tried everything I could think of to replace it and nothing works, all I want is the standard version of this to work.

$(document).on("click", ".alert", function(e) {
bootbox.alert("Hello world!", function() {
console.log("Alert Callback");
});
});

This part is confusing me the most, it's not plug and play like html...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment