[Javascript] changing graphics in new window

Peter Brunone peter at brunone.com
Tue Mar 23 13:55:21 CST 2004


Hi Donna,

	What if you define your window outside the function, and then
check to see if it exists, like this?

var newWindow;

function newWindow(url) {

if(!newWindow.location) {
	newWindow = window.open(url,'newwindow',
	
'width=550,height=420,scrollbars=no,resizable=no,status=no,menubar=no,to
olbar=no');
	}
else {
	newWindow.location.href = url;
	}
newWindow.focus();

}


It's not tested, but should be pretty close to what you want.

Cheers,

Peter


-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Donna M. Acott

Hi,

I'm pretty much a beginner with Javascript, so please forgive me if the
answer to my question is obvious.

I've launched a new window and would like to be able to click on various
graphics in the parent window, and have them change in the child window.
I used window.focus, but when I click on a graphic in the parent window,
I get a bit of "flicker" when I go back to the parent window to click on
a new graphic. Is there a way to get the new window to stay where it is,
even when I click within the parent window? Here is what I've got:

function newWindow(url) {

var newWindow =
window.open(url,'newwindow','width=550,height=420,scrollbars=no,resizabl
e=no
,status=no,menubar=no,toolbar=no');

newWindow.focus();

}


I'd thought of remote control, but everything I read tells me how to
control the parent from the child, not vice versa. I'd appreciate any
help you can give.

- Donna





More information about the Javascript mailing list