Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 29th, 2004, 3:09 PM   #1
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Jul 29th, 2004, 3:30 PM   #2
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
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
Mjordan2nd is offline   Reply With Quote
Old Jul 29th, 2004, 4:56 PM   #3
scientica
Newbie
 
scientica's Avatar
 
Join Date: Apr 2004
Location: Sweden
Posts: 10
Rep Power: 0 scientica is on a distinguished road
Send a message via ICQ to scientica
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?
scientica is offline   Reply With Quote
Old Jul 29th, 2004, 10:42 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:25 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC