Bug Tracker

Ticket #1061 (closed bug: fixed)

Opened 2 years ago

Last modified 1 year ago

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

Reported by: geoffreyk Assigned to: anonymous
Type: bug Priority: minor
Milestone: 1.1.3 Component: core
Version: 1.1.2 Keywords: iframe IE 6 refresh ready
Cc: Needs: Commit

Description

create a page with two iframes

(I will try to attach the files as well)

container.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "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 "-//W3C//DTD HTML 4.01//EN" "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 "-//W3C//DTD HTML 4.01//EN" "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

container.html (317 bytes) - added by geoffreyk 2 years ago.
container.html
left.html (216 bytes) - added by geoffreyk 2 years ago.
left.html
right.html (214 bytes) - added by geoffreyk 2 years ago.
event.diff (0.9 kB) - added by john 2 years ago.
Tweaked the patch to use jQuery() and the actual window (not the window element).

Change History

Changed 2 years ago by geoffreyk

container.html

Changed 2 years ago by geoffreyk

left.html

Changed 2 years ago by geoffreyk

Changed 2 years ago by brandon

  • summary changed from Bug during refresh in ie 6 & 7 - at least with Iframes to [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 2 years ago by john

  • need set to Commit
  • summary changed from [PATCH] Bug during refresh in ie 6 & 7 - at least with Iframes to Bug during refresh in ie 6 & 7 - at least with Iframes

Changed 2 years ago by john

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

Changed 2 years ago by brandon

  • status changed from new to closed
  • resolution set to fixed

Fixed in Rev. [1795].

Note: See TracTickets for help on using tickets.