手机
当前位置:查字典教程网 >编程开发 >AJAX相关 >ajax的 responseXML返回接受 asp
ajax的 responseXML返回接受 asp
摘要:第一个文件index.aspvarxmlHttp=false;//ajax使用try{xmlHttp=newActiveXObject("M...

第一个文件index.asp

<scriptlanguage="javascript">

varxmlHttp=false;//ajax使用

try{

xmlHttp=newActiveXObject("Msxml2.XMLHTTP");

}catch(e){

try{

xmlHttp=newActiveXObject("Microsoft.XMLHTTP");

}catch(e2){

xmlHttp=false;

}

}

if(!xmlHttp&&typeofXMLHttpRequest!='undefined'){

xmlHttp=newXMLHttpRequest();

}

functioncallserver()

{

varurl="index.asp";

xmlHttp.open("POST",url,true);

xmlHttp.onreadystatechange=update;

xmlHttp.setrequestheader("content-type","application/x-www-form-urlencoded");

xmlHttp.send(null);

}

functionupdate()

{

if(xmlHttp.readystate==4)

{

varxmldoc=xmlHttp.responseXML

varinfo=xmldoc.getElementsByTagName("info")[0].text;

alert(info);

}

}

callserver();

</script>

第二个login.asp

<%

Response.ContentType="text/xml"

response.Write("<?xmlversion='1.0'encoding='GB2312'?>")

response.Write("<root>")

response.Write("<info>loveyou</info>")

response.Write("</root>")

%>

【ajax的 responseXML返回接受 asp】相关文章:

ajax的responseText乱码的问题的解决方法

ASP.NET与Ajax的实现方式小总结

javascript Ajax获取远程url的返回判断

ajax 缓存 问题 requestheader

Ajax中responseText返回的是一个页面而不是一个值

一款经典的ajax登录页面 后台asp.net

关于ajax的多次请求问题

Ajax长连接项目案例

JQuery ajax返回JSON时的处理方式 (三种方式)

ajax返回的json内容进行排序使用sort()方法实现

精品推荐
分类导航