Forum Moderators: open

Message Too Old, No Replies

Load another site in a new window

         

Basher

2:57 pm on Feb 16, 2004 (gmt 0)

10+ Year Member



Hi I need some help, I am trying link from a site to to another sire but i want to close the original browser window and open the new site in a new browser window? I also want this to happen automatically so the viewer won't have to click any links
I know i should be able to do this but i think i have lost myself
Cheers in advance

korkus2000

3:02 pm on Feb 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Basher welcome to the board,

Unfortunetly you cannot close windows that you did not open. If you did open this window then you can use parent.window.close() from the window you spawned.

Did you spawn the original window?

PCInk

3:05 pm on Feb 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Why would you want to do that? The only reason I can think of is that you want to disable the back button, which is a very bad thing for your site - what if the user has clicked on the wrong link and wants to go back to click on the correct link?

Opening a new window and then closing the old one is the same as going from one page to the next, but a lot slower as it loads in a new version of the browser (in some cases) and is prone to pop-up blockers that will merely close the browser down because your script gets ignored when opening a new page but succesfully closes the old browser down!

Basher

3:28 pm on Feb 16, 2004 (gmt 0)

10+ Year Member



WOW thanks for your quick replys! The situation is due to having an old site that has a "UK2.net" banner and i want to redirect viewers to the new site that has no banner on but if i just do a link it opens the new site in the view with the banner(if that makes sence)

grahamstewart

4:36 pm on Feb 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Specify
target="_top"
on the link to the new site. This will break out of the frames.

Basher

10:14 pm on Feb 16, 2004 (gmt 0)

10+ Year Member



Hey gang thanks for all your help sorted now thanks to you all

Basher

8:41 pm on Feb 17, 2004 (gmt 0)

10+ Year Member



Sorry gang but i need your help again!

ooop's i was just using this on the AHREF link not on the refresh meta link, i now find that the _top command will not break out of the frames as in :-
<META http-equiv="refresh" content="5;
URL=http://www.anything.co.uk" TARGET="_top">

PCInk

8:58 pm on Feb 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could use a one-line JavaScript to perform an immediate redirection to the top level. document.replace("...") should do the trick without losing the back button facility. (Does parent.document.replace work?)

Keep the META refresh anyway - for those who do not have JavaScript enabled.

Basher

4:19 pm on Feb 18, 2004 (gmt 0)

10+ Year Member



Thanks, I don't know any java script how would i put this into the html page?
sorry for being thick