看你原来的帖子,如果不行再这样取内容function getHTML(o){
var r="";
for(var i=0;i<o.childNodes.length;i++)r+=o.childNodes[i].nodeValue;
return r;
}
var xmlObj = xmlhttp.responseXML;
var childs = xmlObj.getElementsByTagName("string");// 数据
for(var i=0,len=childs.length; i<len; i++)
{
if(childs[i].firstChild != null)
strArr[strArr.length] = document.all?childs[i].firstChild.nodeValue:getHTML(childs[i]);
else
strArr[strArr.length] = "";
}
var r="";
for(var i=0;i<o.childNodes.length;i++)r+=o.childNodes[i].nodeValue;
return r;
}
var xmlObj = xmlhttp.responseXML;
var childs = xmlObj.getElementsByTagName("string");// 数据
for(var i=0,len=childs.length; i<len; i++)
{
if(childs[i].firstChild != null)
strArr[strArr.length] = document.all?childs[i].firstChild.nodeValue:getHTML(childs[i]);
else
strArr[strArr.length] = "";
}
在IE可以这样使用childs[i].firstChild.nodeValue
应该使用另外一个,具体的还要再找一下!
'<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">' +
'<string />'+
"<string><![CDATA[[{Pack_Id:'1804',Pack_AllCode:'KHL-001&#40;Kjiacheng-0809060001&#41;',Pack_Bulk:'0.056',Pack_GrossWeigth:'29.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;14:46:29',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'625',TotalFactPrice:'2350.000'},{Pack_Id:'1805',Pack_AllCode:'KPY-001&#40;Kjiacheng-0809060002&#41;',Pack_Bulk:'0.012',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;14:49:15',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'120',TotalFactPrice:'960.000'},{Pack_Id:'1806',Pack_AllCode:'KPY-002&#40;Kjiacheng-0809060003&#41;',Pack_Bulk:'0.036',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;14:49:42',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'120',TotalFactPrice:'1320.000'},{Pack_Id:'1807',Pack_AllCode:'KXC-001&#40;Kjiacheng-0809060004&#41;',Pack_Bulk:'0.048',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;14:50:38',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'180',TotalFactPrice:'1170.000'},{Pack_Id:'1808',Pack_AllCode:'KFH-001&#40;Kjiacheng-0809060005&#41;',Pack_Bulk:'0.015',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;14:51:47',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'132',TotalFactPrice:'1716.000'},{Pack_Id:'1809',Pack_AllCode:'KML-001&#40;Kjiacheng-0809060006&#41;',Pack_Bulk:'0.024',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;14:55:23',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'468',TotalFactPrice:'6684.000'},{Pack_Id:'1810',Pack_AllCode:'KBS-001&#40;Kjiacheng-0809060007&#41;',Pack_Bulk:'0.070',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:03:23',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'1200',TotalFactPrice:'4560.000'},{Pack_Id:'1811',Pack_AllCode:'KBS-002&#40;Kjiacheng-0809060008&#41;',Pack_Bulk:'0.070',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:03:45',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'1320',TotalFactPrice:'5160.000'},{Pack_Id:'1812',Pack_AllCode:'KML-002&#40;Kjiacheng-0809060009&#41;',Pack_Bulk:'0.127',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:12:08',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'708',TotalFactPrice:'5301.600'},{Pack_Id:'1813',Pack_AllCode:'KML-003&#40;Kjiacheng-0809060010&#41;',Pack_Bulk:'0.015',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:14:13',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'408',TotalFactPrice:'3895.200'},{Pack_Id:'1814',Pack_AllCode:'KML-004&#40;Kjiacheng-0809060011&#41;',Pack_Bulk:'0.070',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:15:52',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'407',TotalFactPrice:'5237.600'},{Pack_Id:'1815',Pack_AllCode:'KXZJ-001&#40;Kjiacheng-0809060012&#41;',Pack_Bulk:'0.158',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:17:30',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'200',TotalFactPrice:'1260.000'},{Pack_Id:'1816',Pack_AllCode:'KXZJ-002&#40;Kjiacheng-0809060013&#41;',Pack_Bulk:'0.050',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:17:47',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'200',TotalFactPrice:'1260.000'},{Pack_Id:'1817',Pack_AllCode:'KFC-001&#40;Kjiacheng-0809060014&#41;',Pack_Bulk:'0.127',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:18:55',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'240',TotalFactPrice:'1800.000'},{Pack_Id:'1818',Pack_AllCode:'KFC-002&#40;Kjiacheng-0809060015&#41;',Pack_Bulk:'0.127',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:18:55',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'240',TotalFactPrice:'1800.000'},{Pack_Id:'1819',Pack_AllCode:'KFC-003&#40;Kjiacheng-0809060016&#41;',Pack_Bulk:'0.127',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:18:55',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'240',TotalFactPrice:'1800.000'},{Pack_Id:'1820',Pack_AllCode:'KFC-004&#40;Kjiacheng-0809060017&#41;',Pack_Bulk:'0.127',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:18:55',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'240',TotalFactPrice:'1800.000'},{Pack_Id:'1821',Pack_AllCode:'KFC-005&#40;Kjiacheng-0809060018&#41;',Pack_Bulk:'0.127',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:18:55',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'240',TotalFactPrice:'1800.000'},{Pack_Id:'1822',Pack_AllCode:'KXN-001&#40;Kjiacheng-0809060019&#41;',Pack_Bulk:'0.158',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:33:52',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'48',TotalFactPrice:'792.000'},{Pack_Id:'1823',Pack_AllCode:'KXN-002&#40;Kjiacheng-0809060020&#41;',Pack_Bulk:'0.050',Pack_GrossWeigth:'30.000',Pack_Suttle:'25.000',Input_time:'2008-9-6&nbsp;15:34:13',Storage_Name:'加乘江东仓库',Pack_InputUName:'万琼-萍',Number:'120',TotalFactPrice:'3720.000'}]]]></string>"+
'</ArrayOfString> ';
var dom;
if(window.ActiveXObject){
dom=new ActiveXObject("microsoft.xmldom");
dom.loadXML(xml);
}
else if(document.implementation&&document.implementation.createDocument){
dom=new DOMParser().parseFromString(xml,"text/xml")
}
if(dom){
var string=dom.getElementsByTagName("string");
for(var i=0;i<string.length;i++){
if(string[i].firstChild)alert(string[i].firstChild.nodeValue);
}
}
else alert("创建对象失败!");