Implementing a Custom Modal for Unsaved Changes on Page Refresh

I am trying to notify user their changes will be lost on refresh when they click browser refresh. but I am not able to do it with custom modal. is it possible to use custom modal instead of broswer's default popup. shared brower's default popup.
No description
3 Replies
ἔρως
ἔρως2w ago
you cant you can use the beforeunload event to show the message you have there but even then, it is very unreliable what you can do is to save the data to local storage, just in case the browser is deleted and when the page loads again, you load the existing data
amitsoni
amitsoniOP2w ago
okay, Thanks
ἔρως
ἔρως2w ago
you're welcome too many websites abused the tools needed for what you wanted to do, so, browsers stopped that

Did you find this page helpful?