What is your doctype for the page?  strict doctypes will render under
document.documentElement rather than document.body.

Not sure if there's any particular reason you're doing it this way
though.  It would probably be much simpler to do something like....

jQuery("body").append("<div />")

On Fri, Jun 5, 2009 at 9:07 AM, Lideln<lid...@gmail.com> wrote:
>
> Hi !
>
> I have an issue... What is weird, is that my colleagues don't have
> it ! (and I did not have it this morning)
> It happens only on IE6... Everything is fine under Firefox (3), Safari
> (4 beta) and Opera (9.64).
>
> When logging in into my application, IE tells me "document.body is
> null or is not an object".
> I have the IE6 debugger installed, and it points me toward : (I used
> the "normal" jquery version to show the plain text code)
>
> [code]
> // Figure out if the W3C box model works as expected
> // document.body must exist before we can do this
> jQuery(function(){
>        var div = document.createElement("div");
>        div.style.width = div.style.paddingLeft = "1px";
>
>        document.body.appendChild( div ); <--- error happens here
>        jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
>        document.body.removeChild( div ).style.display = 'none';
> });
> [/code]
>
> How can this be possible ?
>
> Thank you for any possible lead that could help me get rid of this
> error...
>
> Kind regards,
>
>

Reply via email to