主頁(yè) > 知識(shí)庫(kù) > ajax的 responseXML返回接受 asp

ajax的 responseXML返回接受 asp

熱門標(biāo)簽:銀行業(yè)務(wù) Mysql連接數(shù)設(shè)置 服務(wù)器配置 阿里云 科大訊飛語(yǔ)音識(shí)別系統(tǒng) Linux服務(wù)器 團(tuán)購(gòu)網(wǎng)站 電子圍欄
第一個(gè)文件   index.asp
script language="javascript">
var xmlHttp = false;    //ajax使用
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp  typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
function callserver()
{
 var url = "index.asp";
 xmlHttp.open("POST",url,true);
 xmlHttp.onreadystatechange = update;
    xmlHttp.setrequestheader("content-type","application/x-www-form-urlencoded");
 xmlHttp.send(null);
}
function update()
{
 if(xmlHttp.readystate==4)
 {
  var xmldoc=xmlHttp.responseXML
  var info = xmldoc.getElementsByTagName("info")[0].text;
  alert(info);
 }
}
callserver();
/script>

 

第二個(gè)   login.asp

%
Response.ContentType="text/xml"
response.Write("?xml version='1.0' encoding='GB2312' ?>")
response.Write("root>")
response.Write("info>love you/info>")
response.Write("/root>")
%>
您可能感興趣的文章:
  • Ajax中responseText返回的是一個(gè)頁(yè)面而不是一個(gè)值
  • ajax的responseText亂碼的問(wèn)題的解決方法
  • jquery ajax學(xué)習(xí)筆記2 使用XMLHttpRequest對(duì)象的responseXML
  • Ajax request response 亂碼解決方法
  • Ajax Throws Sys.WebForms.PageRequestManagerErrorException with Response.Redirect的解決方法
  • 關(guān)于Ajax中通過(guò)response在后臺(tái)傳遞數(shù)據(jù)問(wèn)題

標(biāo)簽:江蘇 大理 廣元 萍鄉(xiāng) 棗莊 蚌埠 衢州 衡水

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ajax的 responseXML返回接受 asp》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266