onbeforeunload - Strategies for preserving form data ( on tab/browser close ) -
I have a work management application that sometimes users close their browsers / tabs and the information they type They get away because they accidentally close a browser / tab, resulting in the text they enter (and can enter some half-hour text).
So I have to provide a solution, I have some ideas, but wanted to input the best to go together, or listen to me if you have a better solution.
Option 1:
-
window.optimize
or possiblywindow.First to close
event a confirmation ( ) Demonstrates the first test and whether there is a text in the logging area and it is not empty. If this is not empty, callwindow.confirm ()
and ask if the user wants to close the tab / window without saving the log.
My concern with option # 1 is that it can be intruder to the user.
Option 2:
- At the same event, do not open any confirmation (), but rather save the text effectively. The task logging area in a cookie can then : Provide a button that attempts to restore any saved work information from a cookie on a single page, so that the button will help to parse cookies and get the information.
If the user is doing anything to remove it before submitting There is enough profit for them, so they should not infiltrate to ask if they want to do something that is apparently stupid.
In addition to this, SO has used a confirmation dialog when navigating, and here is the most (some) users
It is very easy.
This is the easiest to use, and probably will help users more.
If someone writes a long piece of text, then without turning the browser off, collecting it, they can be more pleased to solve the problem there, and instead of going out the next morning, they It did not ...
Comments
Post a Comment