Skip to main content

Bug Tracker

Side navigation

#4558 closed bug (fixed)

Opened April 19, 2009 10:33AM UTC

Closed December 09, 2009 05:32PM UTC

IE error when redirecting

Reported by: joseprio Owned by:
Priority: major Milestone: 1.4
Component: support Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

While using JQuery and JQuery UI I get the following error in Internet Explorer 7 when I try to change the 'window.location' during load:

Line: 3203

Error: 'document.body' is null or not an object

That line in jquery.js is:

document.body.appendChild( div );

(it's part of support.js)

I would put a 'try... except' block in that function, or check for 'document.body'.

I'm attaching a simple test case.

Attachments (1)
  • test.html (0.5 KB) - added by joseprio April 19, 2009 10:33AM UTC.

    Test case

Change History (3)

Changed October 19, 2009 01:54AM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

Duplicate of #4320, moved test case to there. Thanks!

Changed December 09, 2009 12:31PM UTC by Iphitos comment:2

resolution: duplicate
status: closedreopened

This error still exists with MSIE 8.0 and jQuery 1.3.2.

I was checking a page in its HEAD-section using JS if it is shown in my desired frameset. If it was not, I was using top.location.replace() to change the location so my frameset would be loaded.

The error occured on a few pages, not all... it seems to depend on how much data (JS & HTML) is being loaded for the complete page that does the frameset-check.

Putting try/catch around lines 3202 - 3204 fixed this...

try {

document.body.appendChild( div );

jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;

document.body.removeChild( div ).style.display = 'none';

} catch(e) {}

Changed December 09, 2009 05:32PM UTC by dmethvin comment:3

resolution: → fixed
status: reopenedclosed

Yes, it was fixed for 1.4. Please try with the 1.4 beta and reopen #4320 (*not* this bug) with a test case if the problem still exists.