title: JavaScript to reload the page as GET request
body: <p>I have a seemingly simple question, but can't find the answer. I have a webpage, which may have resulted from a POST request and may have an anchor (#) in the URL. I want to reload this page <em>as a GET request</em> in JavaScript. So it's similar to <a href="https://stackoverflow.com/questions/570015/how-do-i-reload-a-page-without-a-postdata-warning-in-javascriptate">this question</a>, but I actually want to avoid the POST, not just the warning about it.</p>
  
  <p>So, for example, if the page resulted from a POST request to "<a href="http://server/do/some?thing#" rel="noreferrer">http://server/do/some?thing#</a>" I want to reload the URL "<a href="http://server/do/some?thing" rel="noreferrer">http://server/do/some?thing</a>" as a GET. If I try</p>
  
  <pre><code>window.location.reload(true);
  </code></pre>
  
  <p>that causes IE to try a POST. If I instead do:</p>
  
  <pre><code>window.location = window.location.href;
  </code></pre>
  
  <p>this does nothing when the URL has an anchor. Do I really need to do string manipulation myself to get rid of the "#whatever" or is there an easier, "better" way to do this?</p>