title: jQuery Adding Extra Parameters
body: <p>I have the following jQuery Code which I'm using to show or hide a particular section from the page:</p>
  
  <pre><code>&lt;script&gt;
  if(location.search == "?show=success"){
    $('.step, #step1').hide();
    $('.success').show();
    location.hash = 'ka?show=success';
  }
  if(location.search == "?show=successtwo"){
    $('.step, #step1, #FlowFour2').hide();
    $('.success-two').show();
    location.hash = 'ka?show=successtwo';
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>It actually works, but in the process also adds extra parameters to the final URL.</p>
  
  <p>So if I access <a href="http://example.com/ka/?show=success" rel="nofollow noreferrer">http://example.com/ka/?show=success</a>, I get redirected to <a href="http://example.com/ka/?show=success#ka?show=success" rel="nofollow noreferrer">http://example.com/ka/?show=success#ka?show=success</a></p>
  
  <p>Can someone help in this please?</p>