SoFunction
Updated on 2025-02-28

Monitor whether the user closes the browser's js code


[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]

The effect is as follows:

When empty, this selection prompt box will not appear.

But the problem arises again: If I hope the user can save user-related data when clicking the "OK" button to close the browser, then what should I do?
It seems that the only thing to use the onunload parameter is to use.

Modify the above code as follows:


[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]