title: formatting url in jquery
body: <p>I am trying to substitute parameters in my url using jquery with my input in my textbox. Also, I need to percent-encode the input. I am trying to use jquery.validator.format however it is not working. Suggestions?</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
    &lt;script src="http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/jquery.validate.js"&gt;&lt;/script&gt;
  &lt;script language="javascript" type="text/javascript"&gt;    
  $(document).ready(function () {
          $("button").click(function () {
              var str = "http://api.geonames.org/postalCodeSearchJSON?placename={0}&amp;maxRows=10&amp;username=&lt;my username&gt;";
              alert(str);
              var loc = $("#location").val();
              alert(loc);
              str = jQuery.validator.format(str, loc);
              alert(str);
          });
      });
  </code></pre>