开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜