Click to See Complete Forum and Search --> : How do I close a window when leaving it.
glenvern
July 24th, 2007, 01:59 PM
1. How do I close the current window when <a href> linking to another website? I tried <body onUnload="window.close()"> but it didn't work.
2. How do I get the new website to open in the Maximised view?
Mine all currently open in 'Normal screen' (Properties are set to Maximised and they open Maximised from the desktop)
Thanx...
PeejAvery
July 24th, 2007, 02:31 PM
1. How do I close the current window when <a href> linking to another website? I tried <body onUnload="window.close()"> but it didn't work.
Well, why don't you open those links in the same window so you don't have to worry about that? Else you would have to use it onclick="window.close" within the <a> tag. But, that will probably fire before the link, so then you would have to make JavaScript be the link which is not a smart solution.
2. How do I get the new website to open in the Maximised view?
Mine all currently open in 'Normal screen' (Properties are set to Maximised and they open Maximised from the desktop)
Windows handles that. You can specify sizes when you open the window. Just set the window size to the size of the screen properties.
glenvern
July 25th, 2007, 02:54 AM
Hi PeeJavery
1. Can't open a new window in the same window as it's in a framset..
Can you give an example of window.close() when used in the <A href>.
I've not seen that used before..
2. Can't specify a window size as it has to cope with all screen sizes, tried using 100% but that didn't work..
PeejAvery
July 25th, 2007, 07:47 AM
So wait, you are using a frameset? Are you trying to close one of the frame windows and just go to a single window? If so...
<a href="http://www.google.com" target="_parent">Google</a>
glenvern
July 26th, 2007, 02:08 AM
Hi PeejJvery - I rewrote the page and removed the frameset which allowed it to work ok... but I will copy your code for use later thanx..
PeejAvery
July 26th, 2007, 10:24 AM
Smart move. Frames are very Web 1.0. In fact, I would even claim that they are prior to that in usefulness and practicality.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.