当前位置: 代码迷 >> Web前端 >> 施用window.open提交form表单
  详细解决方案

施用window.open提交form表单

热度:126   发布时间:2012-11-17 11:14:15.0
使用window.open提交form表单
今天碰到一个应用,需要在一个固定的Windows中展示数据,而数据又是通过form表单发给Servlet处理并forward(request, response)到另一个view页面来统一展示的
..好吧 表达有点不好..

现在需要,点提交按钮后open一个新的固定页面,并提交父页面的表单数据.
查询关于Window.open
oNewWindow = window.open( [sURL] [, sName] [, sFeatures] [, bReplace])
其中sName这个参数是这么定义的
sName Optional. String that specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an a element.
target是设置或获取目标内容要显示于哪个窗口或框架.
所以就可以这么写了~
chartForm.target = "newWindow";   
var win = window.open("about:blank","newWindow","height=650,width=1000,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");   
win.focus();   
chartForm.submit();
1 楼 jychenok 2010-09-29  
对我有用,谢谢
  相关解决方案