title: How to set window.location.href
body: <p>I have a button on the page which reloads the page based on some value selected. The button's onclick event of calling load_newurl(param).</p>
  
  <pre><code>function load_newurl(param) {
      var url = window.location.href;
      var index = url.indexOf("&amp;test=");
      if (index&gt;=0) {  
          url = url.substring(0, index);
      }
      url = url + "&amp;testrun=" + param;
      window.location.href = url;
      window.location.reload();
  }
  </code></pre>
  
  <p>Above is my function to reload the page. However, window.location.href never gets changed. Do anyone know why? Am I doing something wrong...?</p>
  
  <p>Thank you in advance.</p>