Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is no way to change the look of that browse-away warning dialog. It is a native facility provided by the browser. In fact, on Firefox <a href="https://developer.mozilla.org/en-US/docs/DOM/window.onbeforeunload" rel="nofollow">as of version 4</a> you can't even customize the message by supplying your own string as the return value, rather it always says something like: </p> <blockquote> <p>"This page is asking you to confirm that you want to leave - data you have entered may not be saved."</p> </blockquote> <p>As for excluding various components on your page from the browse-away warning, isn't that simply a matter of extending the technique that you already appear to be using, where you disable the onbeforeunload event in your user event handlers? For example, when clicking the update button or the search button, you can first make sure to "un-hook" the onbeforeunload event by assigning it to null or a no-op function.</p> <p>By the way, looking at all that raw DOM construction you are doing (all the <code>appendChild()</code> calls and <code>setAttribute()</code> calls, etc), I suggest you take a look at some client-side template frameworks. <a href="http://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more" rel="nofollow">Here's a decent-looking list of alternatives</a>. Also <a href="http://angularjs.org/" rel="nofollow">Angular.js</a> from Google is pretty cool too, although not just a templating system per se.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload