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

jsp页面之间传值问题
我现在有几个参数要从一个页面传到另外一个页面,但是两个页面在不同的电脑上
我现在用的方法是
<form method=post action="XXX.jsp" onsubmit="aaa()">
</form>

但是这个方式要求提交的时候点击的是一个submit,当前我的画面上是一个link,所以这个aaa()方法不会被执行,请问有什么好的方案解决吗?谢谢了


注:1,因为是页面在不同的电脑上,所以session,cookie等一些方法都不行 2,不能使用url传值

------解决方案--------------------
AJAX
------解决方案--------------------
用js的formName.submit()
------解决方案--------------------
<form id="myForm" method=post action="XXX.jsp">
</form>
<script>
document.getElementById('myForm').submit();
</script>

------解决方案--------------------
这样可以?
<form id="form1" method=post action="XXX.jsp" onsubmit="return aaa()">
<a href="javascript:document.getElementById('submit1').click()">aaa</a><input type="submit" id="submit1" style="display:none"/>
</form>
<script type="text/javascript">
<!--
function aaa () {
alert('aaa');
}
//-->
</script>
------解决方案--------------------
学习了。。
------解决方案--------------------
4楼可以?~