我打开了一个弹出窗口:
window.open(url, 'mySurvey', 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,dependent,width=1000, height=800,left=50,top=50');
当该窗口打开时,用户可以单击将关闭窗口的链接,然后重定向到父窗口中的页面。
我熟悉window.close()
,这很好用。我不确定如何使用相同的点击操作在父窗口中获取重定向操作。
答案 0 :(得分:1)
您可以使用window.opener
或window.parent
访问打开弹出窗口的窗口。您可以在关闭弹出窗口之前在单击事件中使用它:
function myClickEvent(){
window.opener.location.href = "the_new_url.htm";
//or window.parent.location.href = "the_new_url.htm";
window.close();
}