Javascript:将Onload功能添加到POST弹出页面

时间:2013-09-20 19:12:46

标签: javascript forms popup submit onload

首先发布在这里。我有一个问题,我无法解决。 我有一个弹出窗口(window.open)。让我们说打开“1.php”。它有一个表单,在点击了Id为“提交”的按钮后提交“2.php”。

很容易将一个Onload函数添加到弹出窗口中:

open_window = window.open("1.php", "",'width=100,height=100,location=0');   
open_window.addEventListener("load", function(){//do something}, false);

但我想要一些与众不同的东西。我想要这个:

open_window = window.open("1.php", "",'width=100,height=100,location=0');

// a lot of thing happen. then after certain action, another function does this:

open_window.document.getElementById("Submit").click(); //submits to "2.php"


open_window.addEventListener("load", function(){//DO SOMETHING AFTER 2.PHP HAS LOADED}, false);

这最后一个命令不起作用。我有1.php已经加载。然后将表单提交到2.php并将OnLoad插入2.php。表单已提交,但onload未执行。

有什么想法吗?我尝试了与iframe等效的工具

我感谢任何帮助。

丹尼

0 个答案:

没有答案