title: How to go back one page at a time (Go back to the referring page, not itself)
body: <p>The history back function records requests. A page may request itself many times. So when pressing the back button, you might return to the previous request to the same page.</p>
  
  <p>Here is a very simplified example:</p>
  
  <p>Alice.html:</p>
  
  <pre><code>&lt;h1&gt;This is Alice&lt;/h1&gt;
  &lt;a href="charlie.php"&gt;Go to Charlie&lt;/a&gt;
  </code></pre>
  
  <p>Bob.html:</p>
  
  <pre><code>&lt;h1&gt;This is Bob&lt;/h1&gt;
  &lt;a href="charlie.php"&gt;Go to Charlie&lt;/a&gt;
  </code></pre>
  
  <p>Charlie.php:</p>
  
  <pre><code>&lt;h1&gt;This is Charlie&lt;/h1&gt;
  &lt;p id="output"&gt;Here goes the server output&lt;/p&gt;
  &lt;form method="post"&gt;
  &lt;input type="hidden" id="somevalue" name="somevalue" value="0"&gt;
  &lt;button type="button" onclick="window.history.go(-1);"&gt;Back&lt;/button&gt;
  &lt;button type="submit"&gt;Calculate&lt;/button&gt;
  &lt;/form&gt;
  &lt;script&gt;
  // Simulate some server side action
  document.getElementById("output").innerHTML = document.getElementById("somevalue").value = "Value = " + Math.random();
  &lt;/script&gt;
  </code></pre>
  
  <p>Alice.html and Bob.html both links to Charlie.php. 
  Charlie.php has a form and call itself any number of times, to do some server manipulation of data.</p>
  
  <p>The history back function steps one request back, not one page. To get back to Alice or Bob, the user has to hit the back button the same number of times that she hid the calculate button.</p>
  
  <p><strong>Question</strong>: How to step one page back, regardless of the number of requests to Charlie?</p>
  
  <p>Edit: I'm looking for a generic solution for a simple "back up one page" button, without using server side variables. </p>
  
  <p>A HTML5 only solutions is ok.</p>