日期:2014-05-17  浏览次数:20861 次

页面不跳转
action1.jsp
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
action1
</title>
</head>
<script language="javascript" defer="defer">
  function tz()
  {
  document.frm1.action("action2.jsp");
  }
</script>
<body bgcolor="#ffffff">

<form id="frm1" name="frm1" method="post" >
<input type="submit" name="SubmitExit" value="跳转" onClick="tz()"/>
</form>
</body>
</html>
为什么不跳转到action2.jsp页面呢?

------解决方案--------------------
设置属性不是这样么?document.frm1.action="action2.jsp"
------解决方案--------------------
document.frm1.action("action2.jsp");
楼主不是这么写的 应该这么写: document.frm1.action = "action2.jsp"; document.frm1.submit(); 这样就行了。
还有此处
<input type="submit" name="SubmitExit" value="跳转" onClick="tz()"/> 没必要再将 input type设置为submit了。可以设置为button。