I have a beforeunload` handler on my page to catch situations where the user hasn't saved before, for instance, closing the tab.
The code looks like this :
$(window).bind("beforeunload", function(evt) {
if (TCG.QUE.changeCount > 0){
evt.preventDefault();
var errDlgMsg = "You have unsaved answers. Save the answers before leaving this page or the unsaved answers will be lost.";
bootbox.alert({message: errDlgMsg, title: "Unsaved Answers"});
return false;
}
})
When it fires before the bootbox dialog firing another dialog is displayed which looks like this
I don't want to see that dialog because the bootbox dialog is intended to do the same job. How can I suppress that dialog?