xml_http_request.open("GET",url,true)报对象不支持此属性或方法错误,求解
if (typeof (XMLHttpRequest) == "undefined" && window.ActiveXObject) {
function XMLHttpRequest() {
var xmlhttp_arr=["MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
var xml_request;
for(var i=0;i<xmlhttp_arr.length;i++)
{
if(xml_request=new ActiveXObject(xmlhttp_arr[i]))
break;
}
}
}
var xml_http_request = new XMLHttpRequest();
//发出请求
function send_post() {
var url = "~/xmlDocument/xmlInformation.xml";
xml_http_request.open("GET",url,true);
//当设置readyState属性变化时所触及的事件句柄onreadystatechange
xml_http_request.onreadystatechange=deal_result;
xml_http_request.send(null);
return
}
function deal_result(){
if(xml_http_request.readyState==4)
{
if(xml_http_request.state==200)
{
var res_xml_doc=xml_http_request.respnseXML.documentElement;
var stu=xml_http_request.getElementByTagName("xmlInfo");
for(var i=0;i<stu.length;i++)
{
document.getElementById("href"+i).href=stu.childNodes[0].fristChild.data;
document.getElementById("oDIV"+i).src=stu.childNodes[1].fristChild.data;
}
}
else{
alert("Error Status:"+xml_http_request.status)
}
}
return;
}
繁星淼淼
潇潇雨雨
慕姐4208626
陪伴而非守候
相关分类