Back Button With Javascript
<p>when i hit back button in browser it should navigate to desired location,</p>

<p>but the code written below works for all the buttons including the 'form' buttons</p>

<pre><code>window.onbeforeunload = function () {
       location.replace('http://www.google.com');
       return "This session is expired and the history altered.";
    }
</code></pre>

<p>how i can restrict this functionalty to browsers back button alone</p>

<p>thanks</p>
