Ticket #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 | |
| 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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
