javascript - Trying to focus an already opened popup window from a new page -


i have 2 pages, page "a" , page "b".

page'a" generates js popup window

function loadwindow(){ var params = 'status = 0, height = 300, width = 480, resizable = 0'; if(istouchdevice()){     params = '' } w = window.open('/audio/audioplayer.php?id='+audioid, 'audioplayer', params); w.document.close(); } 

a visitor goes page b (popup window still open). button on page b, when pressed brings focus popup created on page a.

i have tried searching answer yet nothing works. understand can bring focus with

window.open('', 'audioplayer', '');  

or

w.focus(); 

but problem can't figure out how reference popup page "a"

you cannot access other window, because reference dies when go page b. browsers won't allow - security reasons. if possible page access browser tabs.

you can test this. openining pop up, execute window.opener within it. return page a. when browse page b page a. pop up's window's opener property null.

a work around dynamicly load page b page a. way window , reference preserved.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -