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?
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/jquery.validate.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("button").click(function () {
var str = "http://api.geonames.org/postalCodeSearchJSON?placename={0}&maxRows=10&username=<my username>";
alert(str);
var loc = $("#location").val();
alert(loc);
str = jQuery.validator.format(str, loc);
alert(str);
});
});
placenameandusername) come from?