![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() ![]() ![]() |
I'm wanting to close a window (the main browser) with javascript... this is what I have.
javascript:window.close(); It works. But, I do not want it to prompt the user to confirm the closure. I want it to close without the dialog box comming up. Do you guys know of a work around for this?
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#2 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Usually if you have more than one location in the window's histiory, the message will pop up.
I'm not sure if this will work, but try this: window.opener = null (or window.opener = self) window.close() return false Let me know if that works.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#3 |
|
Newbie
|
iirc it's a browser feature - sort of, "a script is trying to close this windows, is this ok with you, user?".
__________________
Regards Scienitca (registered user #335819 - http://counter.li.org ) -- Together in diversity, we each according to ability, to each according to needs, will help this world (to) become better - who did you help today? |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
Thanks for your inputs.
Come to find out the close() will only work if the open() created the window... and in this case, it didn't.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|