title: jquery post and redirect onclick
body: <p>I have this html code</p>
  
  <pre><code>&lt;div&gt;
   &lt;div&gt;&lt;input id="wpsl-search-input1"/&gt;&lt;/div&gt;
   &lt;div&gt;&lt;a id="wpsl-search-button1" href="#" target="_self"&gt;submit&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And this jquery</p>
  
  <pre><code>&lt;script&gt;
  $('#wpsl-search-button1').click(function() {
     var url = '/pages/location-search/?';
     $('#wpsl-search-input1').each(function() {
         url += 'zip=' + $(this).val() + "&amp;";
     });
     window.location.replace(url);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>But for some reason it doesn't work. Any help ?</p>