How to ask confirmation when closing a window?
<p>I want to pop up a message asking for confirmation if the user wants to leave the current page, exactly like stackoverflow does it when you are typing a question.</p>

<p>Could someone help me on this, by giving me a script or redirecting me to an answer (on this site or elsewhere) ?</p>

<p>Thanks</p>
