弹出窗口,我要提交表单的弹出窗口(不为空)。这工作正常,但由于某种原因,我的父窗口第二次打开。JavaScript表单提交与目标
var formelements = document.getElementById("exportform");
formelements.removeAttribute("action");
formelements.setAttribute("target","/path/exportwindow.html");
exportwindow = window.open("/path/exportwindow.html", "myexportwindow", "width=800,height=600,resizable=yes");
formelements.submit();
HTML:
<form id="exportform" action="/path/myfunction" method="post">
所以会发生什么是弹出窗口打开,并在后台我的父窗口打开一个新的标签。谁能告诉我为什么js的行为是这样的?
我们不明白请在堆栈溢出描述它新功能片段 – 2014-09-23 09:25:33
可能重复的[Window.open和通过post方法传递参数](http://stackoverflow.com/questions/ 3951768/window-open-and-pass-by-post-method) – 2016-05-18 19:31:40