[thelist] Weird window targetting problem with javascript links

.jeff jeff at members.evolt.org
Sun Jan 19 01:30:00 CST 2003


roger,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Roger Ly
>
> <a href="something.html" target="MyWindow"
>    onclick="window.open('something.html','MyWindow');
>             return false">blah</a>
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

the only way to open something in the same window is to assign the results
of the window.open() method, an object pointer, to a variable.  ie:

myWin = window.open(...);

then, use the myWin variable to do what you want.  one of the things you'll
need to do is give the popup focus, though you want to do it conditionally
as some browsers don't support the focus() method (it was introduced as a
method of the window object in js1.1).  fwiw, this is why i always call a
function from a link when i'm trying to open a popup.

see if the following doesn't help you out:

http://members.evolt.org/jeff/code/capture_window/index.cfm

enjoy,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list