作者:ytm5295526049760 | 来源:互联网 | 2023-05-18 08:05
IamloadingsomeXMLviaAjax.我通过Ajax加载一些XML。hereisasnippetofthescript:这是脚本的片段:ajaxRequ
I am loading some XML via Ajax.
我通过Ajax加载一些XML。
here is a snippet of the script:
这是脚本的片段:
ajaxRequest.Onreadystatechange= function()
{
if(ajaxRequest.readyState == 4)
{
document.getElementById('loading').innerHTML = 'done';
google_xml = ajaxRequest.responseXML;
document.getElementById('xml').innerHTML = 'XML: '+google_xml.toXMLString();
}
}
The page I am loading is an XML file, the file loads because if I alert(ajaxRequest.responseText); I see it. But I am not sure how to process it as XML I thought the above script would put the XML as a string into the
element but it doesnt.
我加载的页面是一个XML文件,文件加载因为我提醒(ajaxRequest.responseText);我看到了。但我不知道如何将其作为XML处理我认为上面的脚本会将XML作为字符串放入
I have used E4X to process XML a lot in Actionscript but never in JS, can someone give me a hint? Thanks!
我已经使用E4X在Actionscript中处理了很多XML但从来没有在JS中,有人能给我一个提示吗?谢谢!
3 个解决方案