We wish to prevent the page from being closed, or rather give a warning so that the user do not by accident close the page before data is saved.
So we have added code like this (we use jquery):
$(window).bind('beforeunload', function(){
return "Are you sure, save first?";
});
The dialog works fine and it alerts the user and lets them decide if they wish to stay on the page or leave it.
HOWEVER, for some reason, if they click to stay on the page. It seems like something is broken with the session or something. All data that was in the session on the server seems to be lost. So all ajax calls that are made on the page to fetch data and save fields etc fails... we get null pointers on the server since the session data is lost...
What could be causing this and can we work around it somehow?
Aucun commentaire:
Enregistrer un commentaire