当我尝试通过ajax响应读取XML返回时出现问题,这只发生在IE8,不知道为什么?我该怎么做才能解析或从我的XML中获取文本? 这是我的请求,以及我如何获得XML的价值。非常感谢您的回复!
$$('.linkButton').each(function (el) {
el.addEvent('click', function (e) {
e = new Event(e);
e.stop();
var data = 'MyData';
var myRequest = new Request.HTML({
method: 'post', url: 'MyURL.ashx',
onRequest: function () {
//DoSomething
},
onSuccess:
function (responseText, responseXML) {
// do something
alert(responseXML.filter('NodeName')[0].get('text')
}
});
myRequest.send(data);
})
})
XML:
<Node>
<NodeName>Here is the name</NodeName>
<NodeValue>Here is the Value</NodeValue>
</Node>
错误是:
{exception} Unable to get property 'get' of undefined or null reference