Bug Tracker

Opened 13 years ago

Closed 12 years ago

#5579 closed bug (wontfix)

iframe with name="body" blows up at ready() time

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

Description

The following HTML page throws a script error in Safari 4.0.3. If a ready() function is added it will not run.

The error message is: TypeError: Result of expression 'document.body.appendChild' [undefined] is not a function. ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js:3204

Here's the smallest HTML code to reproduce the problem:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script> <iframe name="body"></iframe>

Change History (6)

comment:1 Changed 13 years ago by dmethvin

This might be a manifestation of the problem seen in #3113 with forms. The expression document.body becomes ambiguous and either refers to the body element or the iframe with a name of "body". Not sure if jQuery can do anything about it though.

comment:2 Changed 13 years ago by replaid

I agree with dmethvin's comment, except that I think jQuery should at least be able to operate in that situation. Right now it can't run any $(document).ready() functions at all if such a frame exists!

comment:3 Changed 13 years ago by dmethvin

Component: unfiledsupport

line 3204 is in jQuery.support

comment:4 Changed 13 years ago by dmethvin

Hmmm, perhaps we could use document.getElementsByTagName(‘body’)[0] instead?

comment:5 Changed 12 years ago by dmethvin

Looking at all the places where we use document.body (8 locations currently), maybe it should be in a closure variable and jQuery.ready could set it. Otherwise it's not worth fixing this since it will break elsewhere (for example, a $("body") selector).

comment:6 Changed 12 years ago by snover

Resolution: wontfix
Status: newclosed

Don’t use DOM keywords as names for your frames.

Note: See TracTickets for help on using tickets.