各位大侠:小弟请教一个简单的document.location.href的写法,
现在我在一个javascript的函数里面要用document.location.href,使得页面跳转到tcyw_cfm.jsp,同时在url的后面带上两个参数code,code1,我是这样写的:
document.location.href = '/service/operate/tcyw_cfm.jsp?code='+form.op_code.value+'&code1='+form.op_code1.value;当我只带一个参数code的时候页面可以跳转,加上code1后页面就不跳转了,哪里写错了?谢谢了!!
在线等
现在我在一个javascript的函数里面要用document.location.href,使得页面跳转到tcyw_cfm.jsp,同时在url的后面带上两个参数code,code1,我是这样写的:
document.location.href = '/service/operate/tcyw_cfm.jsp?code='+form.op_code.value+'&code1='+form.op_code1.value;当我只带一个参数code的时候页面可以跳转,加上code1后页面就不跳转了,哪里写错了?谢谢了!!
在线等
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test</title>
</head>
<script type="text/javascript">
function test(){
alert('/service/operate/tcyw_cfm.jsp?code= '+form.op_code.value+ '&code1= '+form.op_code1.value);
}
</script>
<body>
<form method="post" id="form">
<input name="" type="text" id="op_code"/>
<input name="" type="text" id="op_code1"/>
<input name="" type="button" value="click" onclick="test()"/>
</form>
</body>
</html>
如果拼出的路径过长,也会导致转向失败。
IE里,href的最大长度是2K
-----------
这问题感觉好像是没看就问的alert('/service/operate/tcyw_cfm.jsp?code= '+form.op_code.value+ '&code1= '+form.op_code1.value);
--->>>
location.href=