Click to See Complete Forum and Search --> : Change window content (dinamically) from another window ... possible?


GGaona
10-16-2003, 06:28 PM
Here's the deal:

I got a page called "mypage.html" this page uses a button to call a function that opens 3 popup windows. Here's the code:

function popups() {
window.open("page_A.html","A");
window.open("page_B.html","B");
window.open("page_C.html","C");
}

Each popup window opens a page that contains 1 IFRAME.
(Each IFRAME is named differently.. let say IFA, IFB, IFC; but can be changed if needed).

What i want is this:

When i click a link contained on the IFRAME source file of popup window A, the background color of another link (someLink.sytle.background = "white") contained in IFRAME source file of popup window B must change.

I've tried lots of things but i just can't get it done.. is it even possible?

Please help me find a solution because im stuck and i really need to get this done.

Thank you all! :D

gunther_mcfly
10-16-2003, 07:25 PM
to answer your question, yes, it is very much possible as far as i know. i took a crack at it but no luck. your best bet is to look online for "window referencing" documents. sorry :(

GGaona
10-17-2003, 11:37 AM
Well, i think i was going the hard way, so i begun again from the ground and now i can get the control i was looking for. It did someting like this:

window.parent.opener.child_window_var_name.iframe_name.link_name.style.background = "red";


the problem now is that the parent page (the one that contains the variables for the child windows) is redirected to some other location, so these variables are lost!

I've tried to keep them on a cookie, but it does not work.. how can i keep those variables in order to keep control all the time?

chestertb
10-17-2003, 08:47 PM
I had a similar problem.

I'm guessing that the script you were using in <iframe a> to change <iframe b> was loaded in <iframe a>.

I tried doing that, because it seemed logical and economical but, even though the manuals told me it should work, it didn't.

I moved the scripts that manipulated ALL the iframes to the parent. Once I did that, it fixed the problem.

IB

Marcelo
10-18-2003, 09:08 AM
It's possible... See the example:

http://www.desenvolvedores.com/forum/changeBG/index.htm

;)