由于编码,在IE中使用dojo(Ajax)错误解析XMl

时间:2011-02-03 18:12:26

标签: ajax encoding websphere dojo

我想在IE中解析带有dojo(Ajax)的XML,其他浏览器运行得非常好。

示例JavaScript Dojo:

ar xhrArgs = {
url: link,
sync:true,
preventCache:true,
load: function(responseresponse,ioArgs){
var dom = dojox.xml.parser.parse(responseresponse);
var docNode = dom.documentElement;
}
error: function(error){

alert("An unexpected error occurred: " + error); 
//IN IE go to here if the XML have characters like this áéí an others

}

示例XML:

<?xml version=\1.0\ encoding=\ISO-8859-1\ ?>
 <xml>
    <accountNumber>áéíóú</accountNumber>
 </xml>

1 个答案:

答案 0 :(得分:0)

如果要在xml文档中包含重音字符,请确保使用支持它们的编码类型。提示:utf-8没有!尝试使用ISO-8859-1(Latin-1)或将xml数据编码为utf-8。