`
wh8766
  • 浏览: 34833 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

使用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();


这里先打开一个about:blank 为了避免像Servlet传递空数据,然后焦点上移,提交.ok~
分享到:
评论

相关推荐

    layui弹出层按钮提交iframe表单的方法

    如下所示: layer.open({ id: 'LAY_layuipro', //设定一个id,防止重复弹出 ... var inputForm = $(window.frames[layui-layer-iframe + index].document).contents().find(#userForm); inputForm.

    如何将一个表单同时提交到两个地方处理

    [removed]function dosubmit(){ window.open(‘first.php?var1=’+window.form.var1.value+’&var2=’+window.form.var2.value); window.open(‘second.php?var1=’+window.form.var1.value+’&var2=’+window....

    JS打开新窗口防止被浏览器阻止的方法

    本文实例讲述了JS打开新窗口防止被浏览器阻止的方法。分享给大家供大家参考。...第二种、模拟表单(form)提交,原理是指定表单的action为想要打开的URL地址,target设置为”_blank” 代码如下:document.ge

    107个常用Javascript语句.doc

    18.当文件中出现多个form表单时.可以用document.forms[0],document.forms[1]来代替. 19.窗口:打开窗口window.open(), 关闭一个窗口:window.close(), 窗口本身:self 20.状態栏的设置:window.status= "字符 "; 21....

    JavaScript-js宝典笔学习记.txt

    18.当文件中出现多个form表单时.可以用document.forms[0],document.forms[1]来代替. 19.窗口:打开窗口window.open(), 关闭一个窗口:window.close(), 窗口本身:self 20.状态栏的设置:window.status="字符"; 21.弹出...

    107个常用javascript语句

    18.当文件中出现多个form表单时.可以用document.forms[0],document.forms[1]来代替. 19.窗口:打开窗口window.open(), 关闭一个窗口:window.close(), 窗口本身:self "fullscreen=no,channelmode=no,toolbar=no,...

    javascript函数的解释

    18.当文件中出现多个form表单时.可以用document.forms[0],document.forms[1]来代替. 19.窗口:打开窗口window.open(), 关闭一个窗口:window.close(), 窗口本身:self 20.状态栏的设置:window.status="字符"; 21.弹出...

    精通javascript

    第1章(\第1章) ...1.将该实例复制到C:\Inetpub\wwwroot...• 14.4.htm window.open()方法 • 14.5.htm 用链接和按钮实现窗口打开 • 14.6.htm 窗口的打开和关闭 • 14.7.htm 安全关闭...

    详解前端在html页面之间传递参数的方法

    我们经常写form表单,提交时,可以传递参数,如果使用表单,并将其隐藏起来,应该可以达到效果。 除此以外,[removed].href和window.open也可以达到效果。 1、通过form表单传递参数 <html l

    js使用小技巧

    无关闭按钮IE window.open("aa.htm", "meizz", "fullscreen=7"); 统一编码/解码 alert(decodeURIComponent(encodeURIComponent("http://你好.com?as= hehe"))) encodeURIComponent对":"、"/"、";" 和 "?"也编码 ...

    一个客户端的验证小程序ajax

    //第二步 取得表单中需要的数据 var newName =document.f3.uname.value; //第三步 建立要连接的URL并打开服务器的连接(并传值) var url = "regServer.jsp?uname="+newName; //var url="regServer.jsp"; req....

    精通JavaScript

    1.本书附源代码共计381个,其运行环境如下: IE 5或更高版本 Mozilla Firefox 1.5.0.3或更高版本 服务器采用IIS5.1 或以上版本 ...• 14.4.htm window.open()方法 • 14.5.htm ...

    js使用post 方式打开新窗口

    js中一般新打开窗口很简单直接window.open(url);就可以了, 但是由于我希望传递参数到服务端,而且参数看起来很长一串,而且get方式的提交参数长度是有限制的,因此我有以下需求: 1,js中实现post提交 2,返回的...

    Visual C++ 编程资源大全(英文源码 表单)

    07.zip CDialog using animated control 在CDialog中使用动画(12KB)<END><br>8,08.zip Open Dialog with Bitmap Preview 位图预览的打开文件对话框(43KB)<END><br>9,09.zip Standard file open ...

    asp连接数据库代码实例

    转到:<select name=\"select\" onChange=\'javascript:window.open(this.options[this.selectedIndex].value,\"_top\")\'> <%for p=1 to rs.pagecount%> <option value=\"?page=<%=p%>\" ...

    Xpage学习笔记

    2.5.2 Xpage中使用 Spinner(dijit.form.NumberSpinner) 9 2.5.3 在xpage中使用ProgressBar(dijit.ProgressBar) 10 2.5.4 在Xpage中使用树(dijit.Tree) 10 2.5.4.1 JSON与XML数据源 11 2.5.4.2 Box树与Order树 12 2.5...

    Java学习笔记-个人整理的

    \contentsline {chapter}{Contents}{2}{section*.1} {1}Java基础}{17}{chapter.1} {1.1}基本语法}{17}{section.1.1} {1.2}数字表达方式}{17}{section.1.2} {1.3}补码}{19}{section.1.3} {1.3.1}总结}{23}{...

    在b/s开发中经常用到的javaScript技术整理

    3.1 所有的表单的值都不能为空 3.2 多行文本框的值不能为空。 3.3 多行文本框的值不能超过sMaxStrleng 3.4 多行文本框的值不能少于sMixStrleng 3.5 判断单选框是否选择。 3.6 判断复选框是否选择. 3.7 ...

    C#浏览器编程,学习使用

    完成输入内容后,单击“确定”按钮,进入项目VC#开发窗口“Form.cs[设计]”,如图4-3所示。 图4-3 VC#开发窗口“Form.cs[设计]” (2)界面设计(1天) ○1设计菜单栏如图4-4所示。(半天) 图4-4 设计菜单栏 ...

Global site tag (gtag.js) - Google Analytics