Bug Tracker

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#10737 closed bug (fixed)

IE7 / 8 - Fixed Position Test Issue

Reported by: hgblevins <hgblevins@…> Owned by: hgblevins <hgblevins@…>
Priority: high Milestone: None
Component: support Version: 1.7
Keywords: Cc:
Blocked by: Blocking:


When asynchronously loading jQuery 1.7 via RequireJs 1.0.1 in IE7 / 8, fixed position tests at document ready (line 1602) fires, setting testElement to null (line 1653), before attempting to set innerHtml on testElement (line 1658). Script fails since testElement is null at the time of innerHTML assignment.

Issue is not present loading jQuery 1.7 synchronously via script element in head of document in IE7 / 8.

Issue is not present loading jQuery 1.7 asynchronously via RequireJs in the latest versions of Chrome, Firefox, Safari (Mac or PC).

Issue is not present loading jQuery 1.6.4 asynchronously via RequireJs in IE7 / 8 or latest versions of Chrome, Firefox, Safari (Mac or PC).

Change History (6)

comment:1 Changed 4 years ago by timmywil

  • Component changed from unfiled to support
  • Owner set to hgblevins <hgblevins@…>
  • Priority changed from undecided to high
  • Status changed from new to pending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 4 years ago by hgblevins <hgblevins@…>

  • Status changed from pending to new

This seems to be an extreme edge case that is impacted by the number of elements that can load external resources in the body of the document. For this ticket, the element is an iframe. In development, the iframe is loading facebook like buttons. In the test case I've provided, the iframe is loading jquery.com. Both produce the same result.

As the number of iframes in the body increases, the chance of the script error occurring also increases.

jsFiddle test case: http://jsfiddle.net/Z2dzz/

I'm hoping the jsFiddle is enough. In any event, I've provided two screenshots of a local running version of the test case.

Loading jQuery 1.7 Asynchronously: http://businessbullpen.com/images/jquery/10737/Asynchronous.png

Loading jQuery 1.7 Synchronously: http://businessbullpen.com/images/jquery/10737/Synchronous.png

comment:3 Changed 4 years ago by davidhong

EDIT: my post pretty much mirrors what the description states.

Without going into too much detail about async stuff, the issue seems to be that there is an inconsistent behaviour in order of execution:


I've had to wrap those two lines in a if statement to temporarily avoid this problem.

if (testElement !== null) {
  testElement.innerHTML = "";
  testElementParent.removeChild( testElement );

It appears that the code block above (which runs on jQuery onload) clears the testElement. Therefore triggering this error.


testElement = container = null;

Hope this helps.

Last edited 4 years ago by davidhong (previous) (diff)

comment:4 Changed 4 years ago by timmywil

  • Resolution set to fixed
  • Status changed from new to closed

Move clearing the support vars to before the offset doc ready call in case the offset tests are run synchronously. Fixes #10737.

comment:5 Changed 4 years ago by timmywil

#10769 is a duplicate of this ticket.

comment:6 Changed 4 years ago by timmywil

#10790 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.