//由于在url中传递参数时受到长度的限制(好像最大只能1024字节),只能用form方式提交数据到其他页面。 第一种方式:该方式可以直接将form里的内容提交到新打开的zuofei.jsp页面中。 function getWH() { window.open("about:blank","toZuoFei",'status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=600,height=400,top=0,left=220'); document.zuofei.submit(); } <form action="zuofei.jsp" ENCTYPE="multipart/form-data" method="post" name="zuofei" target="toZuoFei"> <input name="receiveunitName" type="hidden" value="sdf"> </form> 第二种方式:在form提交的页面里有iframe,其中的一个frame使用父页面中的form,为解决将数据从父页面传递到第三个页面(父窗体A打开一个页面B,B中嵌入或打开C页面,可以将A的数据直接提交到C页面中)。 A页面部分代码: function getWH() { window.open("about:blank","toZuoFei",'status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=600,height=400,top=0,left=220'); document.zuofei.submit(); } <form action="B.jsp" ENCTYPE="multipart/form-data" method="post" name="zuofei" target="toZuoFei"> <input name="receiveunitName" type="hidden" value="sdf"> </form> <form action="C.jsp" method="post" name="sendform2" target="mainFrame"> <input name="receiveunitName" type="hidden"> </form> //B页面部分代码 <frameset rows="50,*" framespacing="0" border="1" οnlοad="init()"> ============================================================================ 实践 <form name="ModifyShapDiffForm" action="$link.setAction('/MsGraphDiffAction')" method="get" target="diff"> function sdf(){ window.open("about:blank","diff",'status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,width=600,height=400,top=0,left=220'); |
使用window.open传递form
最新推荐文章于 2023-10-09 16:39:16 发布
使用window.open传递form
2008-06-22 20:27