Solved

Problem closing child browser window in IE10

Posted on 2013-01-25
6
1,399 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
ID: 38822004
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
ID: 38829028
Nope, didn't work.  The window still stays open.
0
 
LVL 16

Expert Comment

by:kiranvj
ID: 38829602
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Accepted Solution

by:
ttitus earned 0 total points
ID: 38833606
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
ID: 38833714
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
ID: 38850416
Self solved with further research
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

789 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