469,336 Members | 5,556 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

Using window.opener to try and set a value in the originating window

RWC
Hello,

I am new to JavaScript but until now, have felt my way along fairly
successfully. I have a page showing an image to the user. I use
window.open to open a separate page, listing a bunch of different images
that the user can select. When the user clicks "Submit", I'd like the image
selection page to close and update the image on the originating page.

To "play around" with this command until I can use it successfully, I wrote
the following;

function Button1_onclick() {
window.opener.document.bgcolor='bisque'
window.opener.location.reload()
window.close()
}

The line for changing the back ground color to bisque I pulled from the
netscape site javascript reference for Window.Opener.

Any help on this would be greatly appreciated.

Thanks in Advance!
Rick

Jul 23 '05 #1
2 2113
DU
RWC wrote:
Hello,

I am new to JavaScript but until now, have felt my way along fairly
successfully. I have a page showing an image to the user. I use
window.open to open a separate page, listing a bunch of different images
that the user can select. When the user clicks "Submit", I'd like the image
selection page to close and update the image on the originating page.

To "play around" with this command until I can use it successfully, I wrote
the following;

function Button1_onclick() {
window.opener.document.bgcolor='bisque'
opener.document.style.backgroundColor = "#FFE4C4";
//bisque == #FFE4C4 == 255,228,196
window.opener.location.reload()
opener.location.reload(true);
window.close()
if(window.close)
{
window.close();
};

Note that you can not close a window not opened by javascript. Also,
some browsers (Mozilla-based browsers) can prevent javascript-initiated
window from being closed via javascript.
}

The line for changing the back ground color to bisque I pulled from the
netscape site javascript reference for Window.Opener.

Any help on this would be greatly appreciated.

Thanks in Advance!
Rick


What was not working? Can you provide an url where the problem is?

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Firefox 1.0.3 :)
Jul 23 '05 #2
RWC
Hi DU,

Thanks for the info. I tried what you suggested, but I still can't get it
to work. The pages I'm playing around with are;

http://www.plussafety.com/asppage1.asp

and

http://www.plussafety.com/asppage2.asp

Any suggestions you could give would be greate.

Thanks!
Rick
"DU" <dr*******@hotNOSPAMmail.com> wrote in message
news:3e************@uni-berlin.de...
RWC wrote:
Hello,

I am new to JavaScript but until now, have felt my way along fairly
successfully. I have a page showing an image to the user. I use
window.open to open a separate page, listing a bunch of different images
that the user can select. When the user clicks "Submit", I'd like the
image selection page to close and update the image on the originating
page.

To "play around" with this command until I can use it successfully, I
wrote the following;

function Button1_onclick() {
window.opener.document.bgcolor='bisque'


opener.document.style.backgroundColor = "#FFE4C4";
//bisque == #FFE4C4 == 255,228,196
window.opener.location.reload()


opener.location.reload(true);
window.close()


if(window.close)
{
window.close();
};

Note that you can not close a window not opened by javascript. Also, some
browsers (Mozilla-based browsers) can prevent javascript-initiated window
from being closed via javascript.
}

The line for changing the back ground color to bisque I pulled from the
netscape site javascript reference for Window.Opener.

Any help on this would be greatly appreciated.

Thanks in Advance!
Rick


What was not working? Can you provide an url where the problem is?

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Firefox 1.0.3 :)

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Peter Kirk | last post: by
3 posts views Thread by ctrl+alt+delete | last post: by
5 posts views Thread by Rabia | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.