Skip to main content

Bug Tracker

Side navigation

#5418 closed bug (fixed)

Opened October 28, 2009 11:17PM UTC

Closed October 02, 2010 01:33PM UTC

Last modified March 10, 2012 08:42AM UTC

this[0].ownerDocument is null in IE6

Reported by: jmaki Owned by: brandon
Priority: minor Milestone: 1.3.2
Component: offset Version: 1.3.2
Keywords: ie6 Cc:
Blocked by: Blocking:
Description

In IE6, jQuery throws on error when attempting to calculate the body offset in jQuery.fn.offset. On line 4175, the browser attempts to access the "body" property of this[0].ownerDocument, but this[0].ownerDocument.body is null.

I *think* the correct behavior can be achieved by changing the line above to:

if ( !this[0] || !this[0].ownerDocument ) return { top: 0, left: 0 };

Attachments (0)
Change History (3)

Changed October 28, 2009 11:18PM UTC by jmaki comment:1

Argh; sorry, the code got messed up. It should be:

 if ( !this[0] || !this[0].ownerDocument ) return { top: 0, left: 0 };

Changed October 28, 2009 11:20PM UTC by dmethvin comment:2

component: unfilledoffset
keywords: → ie6
need: ReviewTest Case
owner: → brandon

That will get rid of the error, for sure, but under what circumstances does this error occur? Can you provide a test case?

Changed October 02, 2010 01:33PM UTC by dmethvin comment:3

resolution: → fixed
status: newclosed