Board Thread:Support Requests - Getting Technical/@comment-2213488-20130912184818/@comment-2213488-20130916043233

Cqm wrote: Sorry, I missed the last line when copy pasting it over to add in the preview warning. It should work correctly now.

@T3CHNOCIDE: Possibly, but is there any guarantee that the onclick event will fire before the beforeunload event?

This seems to work for me, it doesn't warn when clicking save, preview or show changes. Let me know how it works for you: First off I want to thank you for all your help. This code works very well. I would call it nearly perfect. The only tiny little detail I would wish for (if it's possible) is to get the warning AFTER I preview a page but BEFORE I save it.

For example, I press Preview. I don't change anything on the page. But I don't Save it yet. If I accidentally click on close, the warning will not appear (because I haven't entered anything into the text box since I'm still previewing it) and I will lose my changes.