firefox 的responseXML.xml 问题

阅读:11416回复:6
2006-12-19 11:05
写私信
楼主#
用 XMLHttpRequest 对象的
responseXML.xml 为什么在 ie 里面 可以获取数据 而 firefox 却得到 undefined 呢?

    var xmldoc = new XMLHttpRequest();

    xmldoc.open('GET',src, false);
    xmldoc.send('');
alert("123");

    return xmldoc.responseXML.xml

这么写的
 xmldoc.responseText 可以得到数据  xmldoc.responseXML.xml 却不可以


var parser = new DOMParser();
xml = parser.parseFromString(xmldoc.responseXML.xml, "text/xml");
的方法也试过了 得道的仍然是 undefined
用 XMLSPY检查了 格式也是良好的呀

我的ie是 7.0 的 firefox是2.0
2006-12-19 11:05
写私信
1楼#
是 responseXML 而不是 responseXML.xml
2006-12-19 11:05
写私信
2楼#
是 responseXML 的 .xml方法 啊 用 responseXML.Text的到的也是 undefined
直接用 responseXML 的到的是 Object XMLdocument
2006-12-19 11:05
写私信
3楼#
请问谁知道啊 ?
2006-12-19 11:05
写私信
4楼#
responseXML就是一个对象,其本身没有xml/Text对象或方法,如果想得到Object XMLdocument请使用responseXML,如果想得到text,请使用responseText
2006-12-19 11:05
写私信
5楼#
对responseXML的操作就是返回doc对象,然后再对这个对象进行操作.
2006-12-19 11:05
写私信
6楼#
你可以将responseTest打印出来,而responseXML无法打印,用FF打开相应XUL文件即可看到response的信息。