Bug Tracker

Opened 11 years ago

Closed 10 years ago

#3705 closed bug (duplicate)

AJAX IE6 with quirks mode runtime error

Reported by: zardoz Owned by: flesler
Priority: major Milestone: 1.3
Component: ajax Version: 1.2.6
Keywords: Cc: zardoz
Blocked by: Blocking:

Description

If you are in IE6 and do an ajax get to insert some snippet with a script/style tag. The new tag is inserted inside the <base> not the <head> causing a runtime error when the ajax call tries to remove the <script> later.

Here's the HTML we had

--- blank line here ignores the DOCTYPE an puts IE in quirks mode --- <!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns= "http://www.w3.org/1999/xhtml" xml:lang= "en" lang= "en"><head><base target="_top"/>

And here's the offending line of jquery.js ajax: function( s ) { ... if( head )

head.removeChild( script );

...

Seems like the change below is more robust and guaranteed to work for any node whatsoever.

if( head && script)

script.parentNode.removeChild( script );

There are a few other places in jquery with does this same kind of removal.

Change History (3)

comment:1 Changed 11 years ago by flesler

Cc: zardoz added
Owner: set to flesler
Status: newassigned

comment:2 Changed 11 years ago by dmethvin

See also #3283.

comment:3 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: assignedclosed

Dup of #4378.

Note: See TracTickets for help on using tickets.