JQuery中ajax的用法

這篇文章主要介紹“JQuery中ajax的用法”,在日常操作中,相信很多人在JQuery中ajax的用法問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”JQuery中ajax的用法”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來自于我們對這個行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價值的長期合作伙伴,公司提供的服務(wù)項目有:域名注冊、網(wǎng)頁空間、營銷軟件、網(wǎng)站建設(shè)、惠東網(wǎng)站維護(hù)、網(wǎng)站推廣。

復(fù)制代碼 代碼如下:


<%
response.Expires=-1
response.CacheControl="no-cache"
%>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../psw.asp"-->
<!--#include file="../../functions/dofunction.asp"-->
<!--#include file="../../functions/showfunction.asp"-->
<!--#include file="../../fqdb/admin/website.asp"-->
<%
cmd = checkstr(request("cmd"),2)
if cmd="loadteacher" then
response.Charset = "gb2312"
set rs=server.CreateObject("adodb.recordset")
sql="select teacher_id,name from Edu_Person"
rs.open sql,conn,1,3
response.write "{""data"":["
i = 0
do until rs.eof
i = i + 1
response.write "{""Id"":"&rs("teacher_id")&",""Name"":"""&rs("name")&"""}"
if i<rs.recordcount then response.write ","
rs.movenext()
loop
response.write "]}"
response.End()
end if
%>

復(fù)制代碼 代碼如下:


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標(biāo)題文檔</title>
<script type="text/javascript" src="../../js/common/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#btn1").click(function(){
//alert("click");
$.ajax({
url:"ajaxtest.asp?cmd=loadteacher",
dataType:"json",
success:function(json){
//var odata = $.parseJSON(json);
var data = json.data;
for(var i = 0,len = data.length;i<len ;i++){
document.writeln(data[i].Name);
}
}
});
});
});
</script>
</head>
<body>
<form id="myform" method="post" action="ajaxtest.asp">
<!--<input type="hidden" name="cmd" value="loadteacher">-->
<select id="tearchers" name="teachers">
<option value="請選擇"></option>
</select>
<input type="button" id="btn1" name="btn1" value="加載老師">
<!--<input type="submit" value="提交">-->
</form>
</body>
</html>

到此,關(guān)于“JQuery中ajax的用法”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

當(dāng)前標(biāo)題:JQuery中ajax的用法
分享路徑:http://bm7419.com/article18/jciogp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、品牌網(wǎng)站設(shè)計微信小程序、網(wǎng)站營銷、定制網(wǎng)站、企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)