title: javascript window.location not working
body: <p>I am new to javascript, and stuck on this problem. I am trying to have the url query string change based on which checkbox checked. But I seem to have some issue with window.location, Some of the JavaScript is below</p>
  
  <pre><code>  var urltest= window.location.pathname;
    var urltest2 = window.location.host;
    var currentURL  = urltest2 + urltest;
    url = currentURL + "?" + arr_opts.join('&amp;');
  
    document.getElementById('myurl').innerHTML = url;
  
    //window.location.href = url;
    window.location = url;
  </code></pre>
  
  <p>The window.location does not work here, but when I change var currentURL to</p>
  
  <pre><code>var currentURLL = window.location.href;
  </code></pre>
  
  <p>it is work, but not with </p>
  
  <pre><code>  var urltest= window.location.pathname;
    var urltest2 = window.location.host;
    var currentURL  = urltest2 + urltest;
  </code></pre>
  
  <p>I need window.location to point page to the currentURL above.</p>
  
  <p>Any help would be appreciated. </p>