我对 jquery 还很陌生,我认为这很简单,但我很挣扎,谷歌似乎没有帮助....
我所拥有的是一个基本形式......
<form>
First Name: < input type="text" name="firstName" id="firstName" />
Surname: < input type="text" name="surname" id="surname" />
<input type="submit" id="submit" value="submit"/>
</form>
现在,当单击提交时,我想转到一个 url,然后将 froms 值添加到 url 字符串(但不使用表单方法 = get),基本上我希望这发生
点击提交转到http://myurl.com/index.html?params=firstNamevalue*surnamevalue
我一直在使用 jquery 进行黑客攻击,但我最喜欢的地方是这样的......
< script src="http://www.google.com/jsapi" type="text/javascript">< /script>
< script type="text/javascript">
google.load("jquery", "1.3.1");
</script>
< script type="text/javascript">
var = firstName $("#firstName").val();
var = surname $("#surname").val();
$('#submit').click(function(){
window.location = ???;
});
< /script>
希望我已经很清楚了-非常感谢您的帮助!
安迪