0
通常情况下,当您需要管理新窗口时,它将使用open()
方法,并且在需要管理父级时使用opener
属性,如本例中:Javascript - 管理通过窗体打开的新窗口
var myWindow = window.open("", "myWindow", "width=200,height=100"); // Opens a new window
myWindow.document.write("<p>This is 'myWindow'</p>"); // Text in the new window
myWindow.opener.document.write("<p>This is the source window!</p>"); // Text in the window that created the new window
当新的窗口已经被形式打开,如本例中的jQuery我的问题是:
$('#form1').html('<form id="f1" action="welcome.php" method="post" target="_blank"><input type="hidden" name="name" value="a"><input type="hidden" name="email" value="[email protected]"><input type="submit"></form>');
$("#f1").submit();
如何管理新的窗口(使用由target="_blank"
),关联它在JavaScript中的新对象? 我需要将opener
属性应用到由窗体打开的新窗口中...
[这个答案](http://okwave.jp/ qa/q6731947.html)按名称显示引用窗口对象,“function getWindow”。如果可以设置名称而不是'_blank',则可以访问该窗口。 –