Bug Tracker

Modify

Ticket #3705 (closed bug: duplicate)

Opened 4 years ago

Last modified 4 years ago

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
Blocking: Blocked by:

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

comment:1 Changed 4 years ago by flesler

  • Cc zardoz added
  • Owner set to flesler
  • Status changed from new to assigned

comment:2 Changed 4 years ago by dmethvin

See also #3283.

comment:3 Changed 4 years ago by dmethvin

  • Status changed from assigned to closed
  • Resolution set to duplicate

Dup of #4378.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.