Click to See Complete Forum and Search --> : Close window within frameset


draconan
10-03-2003, 08:38 AM
Hi,

I have a webpage set up with frames (banner, index & main body frames) and would like to include a link to close down the window.

I've tried the following code in each of the 3 frames but the command is ignored:

<a href="javascript:self.close()" target="_self">Close window now</a>

Any ideas?

pyro
10-03-2003, 09:10 AM
<a href="#" onclick="top.close(); return false;">Close</a> though it won't work for users with JavaScript disabled.

draconan
10-04-2003, 06:12 AM
Hi Pyro.

Thanks for the code. Where should this code be placed. I put it in the contents frame but couldn't get it to work. What am I missing?

draconan
10-05-2003, 01:14 AM
After a few hours sleep, tried the code again and it works perfectly. Have no idea what I was doing wrong before but ... who cares!!

Thanks for your help.

pyro
10-05-2003, 05:46 PM
Great! Glad I could help... :)