【发布时间】:2013-02-26 20:09:48
【问题描述】:
我使用 jquery 作为 xml 解析器(大错误)。但是,我现在投入太多,无法转换。我遇到了 jQuery 自动转义 <style> 标签内容的问题。
var a = $("<style><foo>content</foo></style>"),
b = $("<bar><foo>content</foo></bar>");
b.find('foo').length // => 1
a.find('foo').length // => 0
b.html() // => '<foo>content</foo>'
a.html() // => 'foo>content</foo>'
// ^--- missing '<'
b.text() // 'test'
a.text() // 'foo>content</foo>'
有没有办法阻止 jQuery 这样做?
【问题讨论】:
标签: javascript jquery xml