Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 17th, 2005, 05:03 PM
Registered User
 
Join Date: Oct 2005
Location: Paris, , France.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default window.close() failing to...well...close!

Hoping someone a lot smarter than me can help here!

I have a PHP app used to manage the deal lifecycle for a small start-up. Occasionally a spawned window is failing to close correctly. Here's what I have:

Main window(1) ->> spawns->> Pop-up to add/update comments(1) ->> spawns->> php script to update/save the data into mySQL(3) ->> Refreshes comments display in (1)->>closes pop up.

When page (3) finishes processing (no screen output - just a DB update from posted variabless), it writes the following javascript to the page:

<Script language=Javascript>
 window.opener.parent.comments_frame.document.locat ion.replace(<filename to refresh in a page(1) IFRAME>)
 window.close();
</script>

Normally all is well, the master page (1) freshes in the appropriate IFRAME, and the pop up window closes. Occassionally the processing page (3) doesn't close and the user sees just a white screen. Looking at the source the above javascript is present.

Any ideas? Uses are all on IE6, Windows XP SP2

Thanks
Martin

Reply With Quote
  #2 (permalink)  
Old October 18th, 2005, 08:01 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I run into windows that don't close after a call to window.close() occasionally, though when I see it has been in Firefox, and only after certain events, such as an XMLHttpRequest call. To work around it I put the call to window.close() in a timeout, such as:

setTimeout('window.close();', 1);

Maybe this will work in your situation as well.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
Reply With Quote
  #3 (permalink)  
Old October 31st, 2005, 03:02 PM
Registered User
 
Join Date: Oct 2005
Location: Paris, , France.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks - I'll give it a try and see what happens!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser close when screen saver close Rehanrana Pro VB 6 1 April 7th, 2008 03:09 AM
Window.close muthuprakash83 Javascript How-To 0 August 7th, 2006 12:35 PM
I can open a new window but can't close it camelius ASP.NET 2.0 Basics 0 March 16th, 2006 06:26 AM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM
How do i close pop-up window?: window.close () Burton HTML Code Clinic 2 September 8th, 2003 05:40 AM



All times are GMT -4. The time now is 01:29 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.