Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 8 years ago

#1061 closed bug (fixed)

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 (317 bytes) - added by geoffreyk 13 years ago.
container.html
left.html (216 bytes) - added by geoffreyk 13 years ago.
left.html
right.html (214 bytes) - added by geoffreyk 13 years ago.
event.diff (882 bytes) - added by john 13 years ago.
Tweaked the patch to use jQuery() and the actual window (not the window element).

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by geoffreyk

Attachment: container.html added

container.html

Changed 13 years ago by geoffreyk

Attachment: left.html added

left.html

Changed 13 years ago by geoffreyk

Attachment: right.html added

comment:1 Changed 13 years ago by brandon

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.

comment:2 Changed 13 years ago by john

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 13 years ago by john

Attachment: event.diff added

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

comment:3 Changed 13 years ago by brandon

Resolution: fixed
Status: newclosed

Fixed in Rev. [1795].

Note: See TracTickets for help on using tickets.