javascript - jQuery: prompt user when attempting to refresh or close browser -


scenario: have web app let user 1 set values in form (#div1) , display next user (who comes browser after user 1 without closing browser) (the display shown in #div2 while #div1 hidden). if user 2 refresh browser, values gone.

question: how can alert user when attempts refresh browser? web app on midori , web server cherrypy.

or there way save session regardless of refresh? , how?

are looking for

window.onbeforeunload = function(){     return "are sure want close window?"; } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -