title: ExpressJs "window.location.href" not reloading page
body: <p>I am using ExpressJs in nodejs project where view files are of .ejs extention.</p>
  
  <p>In that I have written Js code -- Where on select box option change I am reloading page. </p>
  
  <p>For reloading page I have written below code</p>
  
  <pre><code>window.location.href = window.location.host.replace( /[\?#].*|$/, "/equipment/"+$('#rigSelect').val());
  </code></pre>
  
  <p>But it's not reloading page instead calling ajax action with <code>canceled</code> status</p>
  
  <p>It's not working in <code>expressjs</code> -- window.location.href should reload page but its calling ajax action.</p>
  
  <p>Let me know how should I reload page?</p>
  
  <p><strong><em>Edit</em></strong> </p>
  
  <p>The Html/Script code</p>
  
  <pre><code>&lt;%- include header.ejs %&gt;
  &lt;script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
              $(function () {
                  var rigRecords = [ rigRecords ]
                  var rigRows = &lt;%- JSON.stringify(rigRecords) %&gt;
  
                  var rigId = [ rigId ]
                  var rigId = &lt;%- JSON.stringify(rigId) %&gt;
  
                      function populate(selector) {
                          $.each(rigRows, function (index, val) {
                              if(rigId == val.id){
                                  $(selector).append('&lt;option value="'+val.id+'" selected&gt;'+val.name+'&lt;/option&gt;');
                              }else{
                                  $(selector).append('&lt;option value="'+val.id+'"&gt;'+val.name+'&lt;/option&gt;');
                              }
                          })
                      }
  
                      populate('#rigSelect');
  
                      var records = [ records ]
                      var rows = &lt;%- JSON.stringify(records) %&gt;
  
                      $.each(rows[0], function (index, val) {
                      //$.each(val, function (index1, val1) {
                              var newTr = '&lt;tr&gt;&lt;td&gt;'+val.name+' (VP Id:'+val.viewpoint_id+')&lt;/td&gt;&lt;/tr&gt;';
                              $('#tbl_equipment').find('.tblBody').append(newTr);
                      //})
                      });
              });
              function reloadPage(){
                  //req.redirect('http://google.com');
                  //window.location.reload();
                  window.location.href = window.location.host.replace( /[\?#].*|$/, "/equipment/"+$('#rigSelect').val());
  
              }
  &lt;/script&gt;
  </code></pre>