-
window.close() query
Here is what I'm doing,
1. Someone comes to my site, it says click her to lauch site
2. Site launches in a new window (600 x 400), centered on the screen
3. When the user clicked 'launch site' it also contained JavaScript to close that window.
Now the problem is when the window is being closed I get a prompt saying somthing like the web page is trying to close the window, do you want to close the window.
I want to close the window without the prompt comming up, I have seen other sites do it and it works, but when I write the same line I get a prompt ?
Is it due to some setting in my browser or somthing ?
Can some one show me (with JS code) how I can close the window without the prompt appearing.
!!! :) Thank You In Advance :) !!!
-
I don't know if there's a way around it, but I think it's a security feature of IE to try to prevent malicious scripts. If you try it in NS or Opera it shouldn't prompt you. If the window has no history (i.e. back and forward disabled), or it was opened using JS, I think you should not get the prompt.
-
top.window.close();
-Matt
-
put it this way. you cannot close any window you didn't open with javascript. sure you can close it but that message will show up. no way around it. I also think it does it in other browsers as well.