window.onbeforeunload not working in Chrome
<p><code>window.onbeforeunload=function();</code> is not working in chrome. It works for IE and Mozila but it not for chrome. Is there any another way to use <code>window.onbeforeunload=function();</code> in chrome?</p>

<p>Please find the below code. Failure.jsp is not calling in Chrome.  Thanks in advance.</p>

<pre><code>window.onbeforeunload = function() {
  window.location='Failure.jsp';
  confirm("onbeforeunload&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"+window.location);
}
</code></pre>

<p>Failure.jsp:</p>

<pre><code>&lt;body&gt;
&lt;h3&gt; &lt;b&gt; Your session Expired&lt;/b&gt;&lt;/h3&gt;
&lt;% session.invalidate();
System.out.println("invalidate&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;");
%&gt;
Click here to &lt;a href="http://localhost:8080/myApplication"&gt;Relogin&lt;/a&gt;
&lt;/body&gt;
</code></pre>
