By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,767 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,767 IT Pros & Developers. It's quick & easy.

How can the change of second window trigger change of first window

P: n/a
xhe
Hi,
I met a technical difficulty and can not overcome.
I have 2 windows, let's name it window1 and window2.
Now in window1, I need to select an image, so I click the link on
window1 to open window2, here, window2 is opened in new browser, and
window1 is still there. And in window2, there are preview of 10
images. And what need to do is as soon as I select any image in
window2, I hope the image selected will be reflected in window1
simultaneous without refreshing window1.
I know this can be done, just don't know what technogy can be used to
trigger the window1 refresh.
we can use cookie to pass value from win2 to win1, but that still need
to refresh win1 manually.
Are there any good suggestions?
Thanks in advance.

Feb 9 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
xhe said the following on 2/9/2007 12:52 PM:
Hi,
I met a technical difficulty and can not overcome.
I have 2 windows, let's name it window1 and window2.
Now in window1, I need to select an image, so I click the link on
window1 to open window2, here, window2 is opened in new browser, and
window1 is still there. And in window2, there are preview of 10
images. And what need to do is as soon as I select any image in
window2, I hope the image selected will be reflected in window1
simultaneous without refreshing window1.
I know this can be done, just don't know what technogy can be used to
trigger the window1 refresh.
we can use cookie to pass value from win2 to win1, but that still need
to refresh win1 manually.
Are there any good suggestions?
Thanks in advance.
window2 has a reference to its parent window via the window.opener
property. Then you have a reference to the parent window and you change
the image as you would in the same page:

window.opener.document.images['imageNAME'].src = newImage;

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.