javascript - Why do windows opened fire the `onload` event only once? -


i've been searching answer problem—with no luck far.

here's code:

var onewwindow = window.open(slink,'_blank'); onewwindow.addeventlistener('load',function() { alert('page loaded'); }, false); 

when popup window/tab opens handler called, if browse inside popup window, handler never called. why? , there way make work?

the base idea user opens popup window , starts browsing in popup, while code in parent window continues working , monitoring happening in popup. popup page page on same domain.

after loading popup first time, attached onunload handler it, call handler in parent window , timer start. parent window's script work contents of popup. however, problem comes lag, if timer runs out , old page inside popup still there, incorrect data , whole script stops. unable attach onunload handler after that.

the onload handler set window whole, not document within window, why isn't handler called?

also, script run of greasemonkey. don't need cross-browser since work firefox.

once user navigates away original page, opened window no longer has load event applied opening window, why alert not fire again.

one approach use have page wraps desired url within iframe (www.mypage.com/myframe?url=someurl.com) page within child window not change, contents of iframe change. here can tell window.opener going on within iframe.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -