解析xmlstring时,\r\n将丢失。如何解决这个问题?
//Example
var string = "<x y=\"line1\r\nline2\"></x>",
xml = $.parseXML(string),
y = xml.documentElement.getAttribute("y");
//Now y is missing the \r\n.发布于 2014-02-21 11:55:39
属性值中的行中断是没有意义的。
<foo bar="line1
line2" />实际上相当于:
<foo bar="line1 line2" />将属性值编码如下:
<foo bar="line1
line2" />https://stackoverflow.com/questions/21933360
复制相似问题