Tip for front-end page modification

similar to the online editor of the network flowchart, it needs to provide editing, saving and other functions and prompt accordingly, for example, after making data changes, you need to have unsaved * prompts in editors such as word. I would like to ask how to complete the function of comparing the response prompts, and if you compare the data, whether too much data will lead to problems such as slow browsers.

Jan.08,2022

it is recommended to use vue, to bind data bidirectionally, and each form item is validated separately with blur.


there are two ways
one is to monitor the modification of the data on the page. Set a flag to true, as long as it has been modified, so as to trigger the closure of the browser. As long as the flag is true, you can pop up a prompt.

the second is to make a full comparison of the data directly. If there is a direct rough toString () solution for objects or arrays, there is no problem when the amount of data is not very large.

for monitoring browser closure events, you can use window.onbeforeunload,. For more information, please see https://developer.mozilla.org.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7b34b1-2971a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7b34b1-2971a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?