title: Javascript - Page Reload Not working With Hashed Value
body: <p>I am currently in a URL like this-</p>
  
  <blockquote>
    <p><a href="http://localhost:8000/settings#social_accounts" rel="nofollow">http://localhost:8000/settings#social_accounts</a></p>
  </blockquote>
  
  <p>I want to reload this page with <a href="http://www.w3schools.com/js/" rel="nofollow">JS</a> / <a href="https://jquery.com/" rel="nofollow">jQuery</a> so that I can have my exact URL with hash .</p>
  
  <p>So what I have done is-</p>
  
  <p>Way 1-</p>
  
  <pre><code>location.reload();
  </code></pre>
  
  <p>Way 2-</p>
  
  <pre><code>location.reload(true);
  </code></pre>
  
  <p>Way 3-</p>
  
  <pre><code>window.location.replace(window.location.href);
  </code></pre>
  
  <p>Way 4-</p>
  
  <pre><code>window.location.href += window.location.hash;
  location.reload(window.location.href);
  </code></pre>
  
  <p>But nothing is working. Every of this 4 way is giving me a redirect to </p>
  
  <blockquote>
    <p><a href="http://localhost:8000/settings" rel="nofollow">http://localhost:8000/settings</a></p>
  </blockquote>
  
  <p>But I want redirect URL - <a href="http://localhost:8000/settings#social_accounts" rel="nofollow">http://localhost:8000/settings#social_accounts</a></p>
  
  <p>Can anyone please help?</p>