jQuery如何获取表单中的数据?如何通过window location href传值?

1.var code = KaTeX parse error: Expected 'EOF', got '#' at position 3: ("#̲code_io").val()…("#code_io"):$()选择器,选择表单中id=code_io的 文本域,val() 是jQuery中特有的获取方法!
2.如何通过window.location.href传值?
?一个值&&第二个值
window.location.href = “servlet/LoginServlet?id=”+id+"&password="+password;
servlet中利用
String id = request.getParameter(“id”);
String password = request.getParameter(“password”);
获取通过window.location.href传来的值!

$("#lo").click(function() {
		var code = $("#code_io").val();//获取手动输入的验证码
		var id = $("#id").val();       //获取从键盘输入的账号
		var password = $("#password").val();//获取从键盘输入的密码
		
		if (code == "") {
			alert("请输入验证码");
		} else {
			if (sms == code) {
				window.location.href = "servlet/LoginServlet?id="+id+"&password="+password;
				window.event.returnValue=false;
			} else {
				alert("失败后台验证码"+sms);
			}
			;
		}
		;
	});
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值