2010-09-30 163 views
1

頁面x創建彈出窗口(頁面)。當頁面關閉時,我需要在頁面x上觸發的事件。當彈出窗口關閉時在頁面上觸發事件

任何幫助表示讚賞。謝謝。

+0

可能重複[是否有可能用javascript打開彈出窗口,然後檢測用戶何時關閉它?](http://stackoverflow.com/questions/3291712/is-it-possible-to-開放-A-彈出與 - 的JavaScript和 - 然後 - 檢測 - 當最用戶CLOS) – 2010-09-30 23:39:17

回答

1

您可以使用top.opener.document從頁面Ÿ訪問該頁面X:第x頁

top.opener.document.onTrigger(); 

:在頁面Ÿ

function onTrigger()... 
... 
window.open(page_y,...) 

window.opener.document.onTrigger(); 

甚至還有:

top.opener.document.form1.input1.val="xxx"; 
相關問題