Ajax 和 Asp 的編程
更新時(shí)間:2006年10月18日 00:00:00 作者:
ajax.html
<script>
function f(){
var req =new ActiveXObject("Microsoft.XMLHTTP");
req.open("GET","t.asp?t1="+t1.value, true);
req.onreadystatechange = function(){
if (req.readyState == 4) {
if (req.status == 200) {
msg.innerText = req.responseXML.documentElement.tagName;
}
}
}
req.send(null);
}
</script>
<div>1:顯示"OK"; 其他字符:顯示"Error"</div>
<input id=t1 value=1>
<input type=button value="檢測(cè)" onclick="javascript:f()"> <a href="javascript:f()">檢測(cè)</a>
<div id=msg></div>
t.asp
<%
Response.ContentType="text/xml"
response.charset="gb2312"
if request.querystring("t1")="1" then
response.write("<OK/>")
else
response.write("<ERROR/>")
end if
%>
復(fù)制代碼 代碼如下:
<script>
function f(){
var req =new ActiveXObject("Microsoft.XMLHTTP");
req.open("GET","t.asp?t1="+t1.value, true);
req.onreadystatechange = function(){
if (req.readyState == 4) {
if (req.status == 200) {
msg.innerText = req.responseXML.documentElement.tagName;
}
}
}
req.send(null);
}
</script>
<div>1:顯示"OK"; 其他字符:顯示"Error"</div>
<input id=t1 value=1>
<input type=button value="檢測(cè)" onclick="javascript:f()"> <a href="javascript:f()">檢測(cè)</a>
<div id=msg></div>
t.asp
復(fù)制代碼 代碼如下:
<%
Response.ContentType="text/xml"
response.charset="gb2312"
if request.querystring("t1")="1" then
response.write("<OK/>")
else
response.write("<ERROR/>")
end if
%>
相關(guān)文章
AJAX實(shí)現(xiàn)省市縣三級(jí)聯(lián)動(dòng)效果
這篇文章主要為大家詳細(xì)介紹了AJAX實(shí)現(xiàn)省市縣三級(jí)聯(lián)動(dòng)效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-10-10
Ajax技術(shù)(WEB無(wú)刷新提交數(shù)據(jù))
Ajax技術(shù)(WEB無(wú)刷新提交數(shù)據(jù))...2007-02-02
ajax+php 谷歌搜索框自動(dòng)填充功能 實(shí)例代碼
應(yīng)用Ajax技術(shù) 結(jié)合php語(yǔ)言寫的簡(jiǎn)單的類谷歌搜索框自動(dòng)填充功能。2009-11-11
用ajax實(shí)現(xiàn)預(yù)覽鏈接可以看到鏈接的內(nèi)容
用CSS設(shè)置預(yù)覽彈出窗口的樣式、用JavaScript進(jìn)行服務(wù)器請(qǐng)求并且顯示彈出窗口,需要的朋友可以參考下2014-08-08
Ajax讀取數(shù)據(jù)到表格的實(shí)現(xiàn)代碼
前兩篇我們講了 ajax開始的準(zhǔn)備 與及如何使用ajax技術(shù)進(jìn)行簡(jiǎn)單的數(shù)據(jù)讀?。?/div> 2010-10-10
Ajax實(shí)現(xiàn)城市二級(jí)聯(lián)動(dòng)(二)
這篇文章主要為大家詳細(xì)介紹了Ajax實(shí)現(xiàn)城市二級(jí)聯(lián)動(dòng)的相關(guān)資料,將省份用ajax請(qǐng)求并渲染,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-02-02
Ajax實(shí)現(xiàn)異步用戶名驗(yàn)證功能
當(dāng)用戶填寫好賬號(hào)切換到密碼框的時(shí)候,使用ajax驗(yàn)證賬號(hào)的可用性。這篇文章就主要為大家詳細(xì)介紹了Ajax實(shí)現(xiàn)異步用戶名驗(yàn)證功能,感興趣的小伙伴們可以參考一下2016-05-05最新評(píng)論

