echo '<?xml version="1.0" encoding="gb2312"?>';
while ($row = mysql_fetch_array($result)){
echo '<order>';
echo '<Commodities>'.$row['Commodities'].'</Commodities>';
echo '<UserName>'.$row['UserName'].'</UserName>';
echo '<PayMoney>'.$row['PayMoney'].'</PayMoney>';
echo '</order>';
}这是我在php 中产生的xml,我查过了,有数据的。可是, 我在js中怎么读不出来呢?
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4){
if(xmlhttp.status==200||xmlhttp.status==0){
var doc = xmlhttp.responseXML;
alert(doc.getElementsByTagName("order")[0]);
}
}
}
是null,高手帮帮忙
while ($row = mysql_fetch_array($result)){
echo '<order>';
echo '<Commodities>'.$row['Commodities'].'</Commodities>';
echo '<UserName>'.$row['UserName'].'</UserName>';
echo '<PayMoney>'.$row['PayMoney'].'</PayMoney>';
echo '</order>';
}这是我在php 中产生的xml,我查过了,有数据的。可是, 我在js中怎么读不出来呢?
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4){
if(xmlhttp.status==200||xmlhttp.status==0){
var doc = xmlhttp.responseXML;
alert(doc.getElementsByTagName("order")[0]);
}
}
}
是null,高手帮帮忙
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货