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)
Change History (3)
Changed March 21, 2007 08:52PM UTC by 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 |
---|
Changed March 24, 2007 05:22PM UTC by comment:2
need: | → Commit |
---|---|
summary: | [PATCH] Bug during refresh in ie 6 & 7 - at least with Iframes → Bug during refresh in ie 6 & 7 - at least with Iframes |
Changed April 26, 2007 06:54PM UTC by comment:3
resolution: | → fixed |
---|---|
status: | new → closed |
Fixed in Rev. [1795].
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.