How to setup javascript redirect to send user to back page? see code
<p>with <code>onclick="history.go(-1);return false;"</code> user can navigate to back pages. but if I want to put a confirm method before it takes user to the back.. how would I do that?</p>

<p>I think it can be achieved by doing something like below but I am not sure how to redirect user to back page? </p>

<pre><code>$('.clickme').click(function() {
    if(confirm("Are you sure you want to navigate away from this page?"))
    {
      //window.close();
      // how to redirect to history.go(-1) ??
    }        
    return false;
 });
</code></pre>

<p>Any ideas?</p>

<p>Thank you.</p>

<p><strong>UPDATE</strong></p>

<p>Also is there any way I can check if history has some values in it or is empty?? so that I can alert user if is empty??</p>
