Solved

Problem closing child browser window in IE10

Posted on 2013-01-25
6
1,385 Views
Last Modified: 2013-02-04
My code opens a child window which will fetch the "Updated.htm" page as a background process (if it is done as a foreground process, the animated GIF won't animate).

Once the page returns 200, then the parent window is refreshed, and then the small child window closes.

Everything works perfectly on all browser versions except for IE10.

On IE10, the parent window is refreshed, but the child does not close.

Any idea why the child does not close on IE10?
PageUpdate.htm
0
Comment
Question by:ttitus
  • 3
  • 3
6 Comments
 
LVL 16

Expert Comment

by:kiranvj
Comment Utility
Not sure whether this works, just try.

Add this inside head that in PageUpdate.htm and check in IE10

<meta http-equiv="X-UA-Compatible" value="IE=9">

Open in new window

0
 

Author Comment

by:ttitus
Comment Utility
Nope, didn't work.  The window still stays open.
0
 
LVL 16

Expert Comment

by:kiranvj
Comment Utility
Just add a button in  PageUpdate.htm and in onclick give

self.close();

want to know whether its a problem of self.close();


Also try this in your existing code

replace

self.close();


with

setTimeout(function() {

self.close();

}, 2000);
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Accepted Solution

by:
ttitus earned 0 total points
Comment Utility
Ok, here's the really interesting part.  I added alert() messages around the code to see where IE10 stopped working and discovered something very tricky:

My original code:
opener.Reload();
self.close();

Open in new window


I changed it to the following:
alert("Alert1");
opener.Reload();
alert("Alert2");
self.close();
alert("Alert3");

Open in new window


I discovered that IE10 processes the "opener.Reload();" and refreshes the parent window but it does not return from this to process the alert("Alert2");.

I changed this to the following and it works perfectly in IE10 as well as all other browsers now:
opener.location.reload();
self.close();

Open in new window

0
 
LVL 16

Expert Comment

by:kiranvj
Comment Utility
I changed this to the following and it works perfectly in IE10 as well as all other browsers now:

Thats great... good to know its fixed.

You can close this question by selecting your own solution as answer.

-kiranvj
0
 

Author Closing Comment

by:ttitus
Comment Utility
Self solved with further research
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now