Skip to main content

Bug Tracker

Side navigation

#1061 closed bug (fixed)

Opened March 20, 2007 04:49PM UTC

Closed April 26, 2007 06:54PM UTC

Last modified March 15, 2012 05:23PM UTC

Bug during refresh in ie 6 & 7 - at least with Iframes

Reported by: geoffreyk Owned by:
Priority: minor Milestone: 1.1.3
Component: core Version: 1.1.2
Keywords: iframe IE 6 refresh ready Cc:
Blocked by: Blocking:
Description

create a page with two iframes

(I will try to attach the files as well)

container.html:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http:www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title>Iframe test</title>

<script type="text/javascript" src="jquery-latest.js"></script>

</head>

<body>

<iframe src="left.html"></iframe>

<iframe src="right.html"></iframe>

</body>

</html>

left.html:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http:www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title>Iframe test</title>

<body style="background-color:yellow">

<p>This is 'left'</p>

</body>

</html>

right.html:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http:www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title>Iframe test</title>

<body style="background-color:red">

<p>This is 'right'</p>

</body>

</html>

Load container in ie 6 or 7

(it is easier to reproduce in ie 6 because of the way the refresh button is displayed)

Note that there is one yellow and one red iframe.

Click on refresh or hit F5

note that after refesh, the left Iframe is now showing the incorrect content.

I have tracked the problem down to this section (about line 1488 in the current build):

else if ( jQuery.browser.msie ) {

Only works if you document.write() it

document.write("<scr" + "ipt id=__ie_init defer=true " +

"src=:></script>");

Use the defer script hack

var script = document.getElementById("__ie_init");

script does not exist if jQuery is loaded dynamically

if ( script )

script.onreadystatechange = function() {

if ( this.readyState != "complete" ) return;

this.parentNode.removeChild( this );

jQuery.ready();

};

Clear from memory

script = null;

If Safari is used

}

The specific line that is causing the problem is:

this.parentNode.removeChild( this );

By commenting out this line, the problem goes away.

Not sure why this is happening. Seems clear that this is a bug in IE, but we shouldn't trip over it if we can help it.

Also not sure if this would rear it's ugly head in any other way or if it is limited to just refreshing iframes.

Would it be so bad to leave the defered script in the dom? Is there another way to remove it?

Attachments (4)
  • container.html (0.3 KB) - added by geoffreyk March 20, 2007 04:51PM UTC.

    container.html

  • event.diff (0.9 KB) - added by john March 29, 2007 05:49PM UTC.

    Tweaked the patch to use jQuery() and the actual window (not the window element).

  • left.html (0.2 KB) - added by geoffreyk March 20, 2007 04:51PM UTC.

    left.html

  • right.html (0.2 KB) - added by geoffreyk March 20, 2007 04:51PM UTC.
Change History (3)

Changed March 21, 2007 08:52PM UTC by brandon comment:1

summary: Bug during refresh in ie 6 & 7 - at least with Iframes[PATCH] Bug during refresh in ie 6 & 7 - at least with Iframes

It seems that messing with that script element before window.onload is really making IE upset. I can't explain why it is doing what it is but I've moved the removal of the script element to [[[jQuery.ready]]] and window.onload. This solves the issue but still unsure of the actual cause.

Changed March 24, 2007 05:22PM UTC by john comment:2

need: → Commit
summary: [PATCH] Bug during refresh in ie 6 & 7 - at least with IframesBug during refresh in ie 6 & 7 - at least with Iframes

Changed April 26, 2007 06:54PM UTC by brandon comment:3

resolution: → fixed
status: newclosed

Fixed in Rev. [1795].