title: js if window.location.href not match, then jump to
body: <p>How to make a <code>window.location.href</code> judge?</p>
  
  <p>if <code>window.location.href</code> not match <code>?search=</code>, make the current url jump to <code>http://localhost/search?search=car</code></p>
  
  <p>my code not work, or I should use <code>indexOf</code> to make a judge? Thanks.</p>
  
  <pre><code>if(!window.location.href.match('?search='){
      window.location.href = 'http://localhost/search?search=car';
  }
  </code></pre>