javascript - BB Dialog showing up before alert -


jsfiddle link:

the bootbox.alert should show before bootbox.dialog. i've preloaded libraries jsfiddle. want bootbox.dialog show once bootbox.alert has been clicked on.

check out here

bootbox defined functions here, , can see include callback. example:

bootbox.alert(message, callback) 

the callback gives option run code once line completed. solves problem.

js

$(document).ready(function () {     $('.begin-game').click(function () {         bootbox.alert("this should show first", function () {             bootbox.dialog({                 message: "did pass go?",                 title: "this should go second / last",                 buttons: {                     // passed go                     success: {                         label: "yes passed go!",                         classname: "btn-success",                         callback: function () {                          }                     },                     // did not pass go                     danger: {                         label: "i did not :(",                         classname: "btn-danger",                         callback: function () {                          }                     },                 }             });         });     }); }); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -