0

I have a page with text editor that I want to make sure the user knows that the edits they make will be lost before they actually leave. I have done event.preventDefault() for all links in my page and add my own version of alert box (or to be precise, div that looks like alert box), but for leaving by pressing last page, clicking on a bookmark or typing URL directly, I can only use the ugly default alert box.

Is there a way to customize the alert box on leaving?

cytsunny
  • 4,838
  • 15
  • 62
  • 129
  • I think you can find solution from this. (http://stackoverflow.com/questions/7853130/how-to-change-the-style-of-alert-box) – Gihan Chathuranga Feb 02 '17 at 10:01
  • No, I have similar thing on all other link in my page. The problem is that I don't have a way to trigger my method when using is leaving the page without using the links in my page. – cytsunny Feb 02 '17 at 10:39

0 Answers0