I'm trying to prevent any additional dialogs without needing the additional dialog box to be checked. I'm implementing an autosave feature that is called right before the user closes or refreshes the page, so the "changes you made may not be saved" pop-up is unnecessary. I looked at beforeunload and had no luck.
window.onbeforeunload = null;
$(window).on('unload', function (e) {
$page.model.save(true, function (success) {});
});