View Full Version : remote window functions
macentyre
07-01-2002, 11:57 PM
I cannot firgure out how to write the script to make this popup window control the main browser window beneath via image link within the popup winodw...All the remote scripts I find have th window.open function and I just need to figure out how to control the background window with an image link within the popup window...any help would be very much appreciated!
here's the problem url...within the popup winodw "Order Now" needs to change the background window to that page without loosing the popup window infront
Thanks!!
joh6nn
07-02-2002, 12:20 PM
there are two ways to refer the parent window when using a popup. you can name the parent window by placing this inside the parent window somewhere:
<script>
window.name = "theParent";
</script>
then, you can refer the parent window in links, like so: <A HREF="somepage.htm" TARGET="theParent">.
you can also refer to the parent window using window.opener, in javascript. in this case, i suggest you use window opener.
the specific code that you're looking for, would look somewhat like this:
<A HREF="javascript:window.opener.document.body.style.backgroundImage = 'somePic.gif';"><IMG SRC="somePic.gif"></A>
placing that in your popup window, would change the background picture of the parent window to somePic.gif. alternatively, you could change the background color using
HREF="javascript:window.opener.document.body.style.backgroundColor = '#FFCC99';"
hope that helps.
macentyre
07-02-2002, 05:52 PM
IT WORKED!!!...Thank you soo much man!!
Joey
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.