我试图让jquery读取这个xml。 jQuery运行success函数,但不解析XML。我试过验证xml并找不到声明。感谢。
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<prices>
<pitch securityId="AUXNY" considerationCurrency="usd">
<price actionIndicator="S" limit_kg="55970" limit_fmt_kg="55,970"/>
</pitch>
<pitch securityId="AUXNY" considerationCurrency="usd">
<price actionIndicator="B" limit_kg="56000" limit_fmt_kg="56,000"/>
</pitch>
<pitch securityId="AUXLN" considerationCurrency="usd">
<price actionIndicator="S" limit_kg="56020" limit_fmt_kg="56,020"/>
</pitch>
<pitch securityId="AUXLN" considerationCurrency="usd">
<price actionIndicator="B" limit_kg="56260" limit_fmt_kg="56,260"/>
</pitch>
<pitch securityId="AUXZU" considerationCurrency="usd">
<price actionIndicator="S" limit_kg="56150" limit_fmt_kg="56,150"/>
</pitch>
<pitch securityId="AUXZU" considerationCurrency="usd">
<price actionIndicator="B" limit_kg="56390" limit_fmt_kg="56,390"/>
</pitch>
pitch securityId="AGXLN" considerationCurrency="usd">
<price actionIndicator="S" limit_kg="1290" limit_fmt_kg="1,290"/>
</pitch>
<pitch securityId="AGXLN" considerationCurrency="usd">
<price actionIndicator="B" limit_kg="1293" limit_fmt_kg="1,293"/>
</pitch>
<pitch securityId="AUXNY" considerationCurrency="gbp">
<price actionIndicator="S" limit_kg="34390" limit_fmt_kg="34,390"/>
</pitch>
<pitch securityId="AUXNY" considerationCurrency="gbp">
<price actionIndicator="B" limit_kg="34500" limit_fmt_kg="34,500"/>
</pitch>
<pitch securityId="AUXLN" considerationCurrency="gbp">
<price actionIndicator="S" limit_kg="34420" limit_fmt_kg="34,420"/>
</pitch>
<pitch securityId="AUXLN" considerationCurrency="gbp">
<price actionIndicator="B" limit_kg="34560" limit_fmt_kg="34,560"/>
</pitch>
<pitch securityId="AUXZU" considerationCurrency="gbp">
<price actionIndicator="S" limit_kg="34310" limit_fmt_kg="34,310"/>
</pitch>
<pitch securityId="AUXZU" considerationCurrency="gbp">
<price actionIndicator="B" limit_kg="34400" limit_fmt_kg="34,400"/>
</pitch>
<pitch securityId="AGXLN" considerationCurrency="gbp">
<price actionIndicator="S" limit_kg="786" limit_fmt_kg="786"/>
</pitch>
<pitch securityId="AGXLN" considerationCurrency="gbp">
<price actionIndicator="B" limit_kg="792" limit_fmt_kg="792"/>
</pitch>
<pitch securityId="AUXNY" considerationCurrency="eur">
<price actionIndicator="S" limit_kg="39300" limit_fmt_kg="39,300"/>
</pitch>
<pitch securityId="AUXNY" considerationCurrency="eur">
<price actionIndicator="B" limit_kg="39500" limit_fmt_kg="39,500"/>
</pitch>
<pitch securityId="AUXLN" considerationCurrency="eur">
<price actionIndicator="S" limit_kg="39300" limit_fmt_kg="39,300"/>
</pitch>
<pitch securityId="AUXLN" considerationCurrency="eur">
<price actionIndicator="B" limit_kg="39470" limit_fmt_kg="39,470"/>
</pitch>
<pitch securityId="AUXZU" considerationCurrency="eur">
<price actionIndicator="S" limit_kg="39333" limit_fmt_kg="39,333"/>
</pitch>
<pitch securityId="AUXZU" considerationCurrency="eur">
<price actionIndicator="B" limit_kg="39400" limit_fmt_kg="39,400"/>
</pitch>
<pitch securityId="AGXLN" considerationCurrency="eur">
<price actionIndicator="S" limit_kg="893" limit_fmt_kg="893"/>
</pitch>
<pitch securityId="AGXLN" considerationCurrency="eur">
<price actionIndicator="B" limit_kg="908" limit_fmt_kg="908"/>
</pitch>
</prices>
答案 0 :(得分:0)
尝试在jQuery ajax调用中将标题响应设置为content-type text / xml并将dataType设置为xml。