jQuery append() is broken in IE?
Is jQuery 1.6.4 append()
is brok开发者_如何学Goen in IE?
This code works everywhere but IE6+
$('<xml></xml>').append('<test>hello world</test>');
Is there a way to fix that?
From the docs:
jQuery( html, [ownerDocument] )
html A string of HTML to create on the fly. Note that this parses HTML, not XML.
The argument passed to jQuery is not HTML(there is no html-element xml
) so there will be nothing to append something to.
Take a look at MSDN for informations about creation of XML-Documents in IE<9
精彩评论