|
-
Jan 12th, 2001, 03:22 AM
#1
Thread Starter
Hyperactive Member
Dear all,
I have an html file with two frames. In the first frames document I have a button. I am trying to close the browser window when I ckick on that button. The OnClick event calls a client side function that calls window.close. However it does not work i.e. the window does not get closed. Any ideas/suggestions. Thanks in advance.
-
Jan 12th, 2001, 03:41 AM
#2
Fanatic Member
hi msdn
sorry if this is a stupid question bu have you got the following
window.close();
as If you don't have the brackets, it doesn't cause an error but it also doesn't do anything
Hope this helps
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jan 12th, 2001, 03:59 AM
#3
Thread Starter
Hyperactive Member
Dear Ian,
Thanks for ur quick fire response. I have got the braces in place i.i window.close(). Even then it does not close the window. Note this happens only if there are multiple frames in the parent document. Any ideas.
-
Jan 12th, 2001, 04:04 AM
#4
Fanatic Member
try the following, I think it will sort out your problem
top.parent.window.close();
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Jan 12th, 2001, 03:27 PM
#5
Chances are tho that it won't close immediately but rather prompt the user asking if they want the window closed.
If this happens then it's because you didn't open the window yourself - you can only close windows that your own script opened in the first place. 'tis a security thingy of java & j script.
(Just a bit o useless info for ya. )
BTW...if your code still doesn't work then paste it into a reply thread here so we can all see what we're dealing with.
-
Jan 14th, 2001, 10:44 PM
#6
Thread Starter
Hyperactive Member
Dear Matthew,
You r right the window does not close by itself but it asks for a confirmation. Thanks everybody for all your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|