I am using history.js and ajaxify.js to make my web app ajax enabled. If the user has unsaved changes on the form and they try to go to another page, I need to show them a warning that they will lose their changes if they leave.
I would normally just use window.onbeforeunload = unloadPage;
but this doesn't fire with ajax page loads. How can I prevent the page from changing if they don't want to lose their unsaved edits?