Forum Moderators: open

Message Too Old, No Replies

Only 1 new window

linking to the original spawned window

         

smokeyb

8:09 pm on Mar 12, 2004 (gmt 0)

10+ Year Member



I have noticed on some sites, that if a photo is opened in a new window, clicking on other pix on the parent site opens them in the originally spawned window, instead of another "blank page", so there is only 1 extra window open at any time (unless you shift-click). Can someone tell me how to do this?
Thanks in advance
Smokey

korkus2000

8:44 pm on Mar 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you call window.open in js, you need to call the window the same name everytime.

window.open('test.htm','samenameeverytime','width=100,height=100');

If you do not use this parameter you will open a lot of windows.

If you want to do a regular a tag then use the window name in the target attribute.

brucec

4:38 am on Mar 13, 2004 (gmt 0)

10+ Year Member



Exactly. I also explain to people that the name part of the window.open method in javascript is like calling a target frame in HTML. Whatever that target is named, the web page will go to that frame. The concept used by Window.open works exactly the same way.