The events happen in the new window. You can report them to the parent window using an event handler in the new window.
If something happens in the parent window it can "read" the document in the new window.
The essential thing is to name the new window in the window.open() method, then you can reference it by name in a script in the parent window. Scripts in the new window can reference things in the parent window as
parent.document.this_or_that_thing .
The webpage for the new window is from another server, not under my control. So I can't modify it. I've tried AJAX but run into the cross-domain permission problem, so I'm trying to find a way around it.
When opening the child window from the parent, can I specify something in its attributes that will connect one of its events (say, onLoad) to an event handler in the parent window.
ala,
Code:
var newwin = window.open("thatotherpage.htm", "crazychild", "onLoad=childLoadedEventHandler");
or are attributes just for shaping and sizing the child window?
But I'm abandoning this line of attack (against the AJAX cross-domain barrier) because it's been pointed out that many people disable popups entirely. Maybe I'll try a tiny, hidden iframe...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.