真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

ajax返回json數(shù)據(jù)-創(chuàng)新互聯(lián)


Ajax利用JSON進(jìn)行前后臺交互


獲取所有用戶信息







%3Cbr%20/%3E%20function%20getJson%28RequestData%2CURL%29%7B%3Cbr%20/%3E%20var%20reJson%3B%3Cbr%20/%3E%20%24.ajax%28%7B%3Cbr%20/%3E%20type%3A%27POST%27%2C%3Cbr%20/%3E%20url%3AURL%2C%3Cbr%20/%3E%20data%3ARequestData%2C%3Cbr%20/%3E%20async%3Afalse%2C%20//%u4E3A%u4E86%u7B80%u4FBF%uFF0C%u8BBE%u7F6E%u4E3A%u540C%u6B65%u64CD%u4F5C%3Cbr%20/%3E%20cache%3A%20false%2C%3Cbr%20/%3E%20success%3Afunction%28responseData%29%7B%3Cbr%20/%3E%20reJson%3DresponseData%3B%3Cbr%20/%3E%20%7D%3Cbr%20/%3E%20%7D%29%3B%3Cbr%20/%3E%20return%20reJson%3B%3Cbr%20/%3E%20%7D%3Cbr%20/%3E%20function%20getAllUsers%28%29%7B%3Cbr%20/%3E%20var%20url%20%3D%20%22json.php%22%3B%3Cbr%20/%3E%20var%20request%20%3D%20%27action%3Dget_all_users%27%3B%3Cbr%20/%3E%20//%u4ECE%u540E%u53F0%u83B7%u53D6%u5E76%u89E3%u6790%uFF0C%u7531%u4E8E%u4E0A%u9762%u5C01%u88C5ajax%u91C7%u7528%u7684%u662F%u540C%u6B65%u8FD4%u56DE%uFF0C%3Cbr%20/%3E%20//%u6240%u4EE5%u8FD9%u6837%u64CD%u4F5C%u80FD%u6210%u529F%u83B7%u53D6%u8FD4%u56DE%u6570%u636E%3Cbr%20/%3E%20var%20json%20%3D%20getJson%28request%2Curl%29%3B%3Cbr%20/%3E%20var%20users%20%3D%A0%20eval%28%27%28%27+%20json%20+%27%29%27%29%3B//%u5C06%u5B57%u7B26%u4E32%u8F6C%u5316%u4E3Ajson%u5BF9%u8C61%20%3Cbr%20/%3E%20var%20usersHtml%20%3D%20%27%3Cbr%20/%3E%20%3Cspan%3EAjax%u8FD4%u56DE%u7684JSON%u5B57%u7B26%u4E32%uFF1A%3C/span%3E%3Cbr%20/%3E%20%27%3Cbr%20/%3E%20+%20json%20+%20%27%3Cbr%20/%3E%20%3Cbr%20/%3E%20%3Cspan%3E%u89E3%u6790%u51FA%u6765%u7684%u7ED3%u679C%u4E3A%uFF1A%3C/span%3E%3Cbr%20/%3E%20%27%3B%3Cbr%20/%3E%20for%28var%20i%3D0%3Bi%3Cusers.length%3B++i%29%7B%3Cbr%20/%3E%20usersHtml%20+%3D%20%27userId%20%3D%20%27%20+%20users%5Bi%5D.userId%20+%20%27%3Cbr%20/%3E%20%27%3Cbr%20/%3E%20+%20%27userName%20%3D%20%27%20+%20users%5Bi%5D.userName%20+%20%27%3Cbr%20/%3E%20%27%3B%3Cbr%20/%3E%20%7D%3Cbr%20/%3E%20//%u628A%u6784%u9020%u7684HTML%u5229%u7528jQuery%u52A8%u6001%u663E%u793A%u5230%u9875%u9762%3Cbr%20/%3E%20%24%28%27%23users%27%29.empty%28%29.html%28usersHtml%29%3B%3Cbr%20/%3E%20%7D%3Cbr%20/%3E%20


成都創(chuàng)新互聯(lián)公司專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都做網(wǎng)站、成都網(wǎng)站制作、大悟網(wǎng)絡(luò)推廣、重慶小程序開發(fā)、大悟網(wǎng)絡(luò)營銷、大悟企業(yè)策劃、大悟品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們大的嘉獎;成都創(chuàng)新互聯(lián)公司為所有大學(xué)生創(chuàng)業(yè)者提供大悟建站搭建服務(wù),24小時服務(wù)熱線:13518219792,官方網(wǎng)址:www.cdcxhl.com


//接受請求參數(shù)并根據(jù)參數(shù)選擇操作
if(isset($_POST['action'])&&$_POST['action']!=""){
switch($_POST['action']){
case 'get_all_users': getAllUsers(); break;
default:
}
}

//處理請求:以JSON格式返回所有用戶信息
function getAllUsers(){
$users = array(
array("userId"=>1,"userName"=>"Raysmond"),
array("userId"=>2,"userName"=>"雷建坤"),
array("userId"=>3,"userName"=>"Rita")
);
echo json_encode($users);
}
?>

創(chuàng)新互聯(lián)www.cdcxhl.cn,專業(yè)提供香港、美國云服務(wù)器,動態(tài)BGP最優(yōu)骨干路由自動選擇,持續(xù)穩(wěn)定高效的網(wǎng)絡(luò)助力業(yè)務(wù)部署。公司持有工信部辦法的idc、isp許可證, 機(jī)房獨(dú)有T級流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確進(jìn)行流量調(diào)度,確保服務(wù)器高可用性。佳節(jié)活動現(xiàn)已開啟,新人活動云服務(wù)器買多久送多久。


分享題目:ajax返回json數(shù)據(jù)-創(chuàng)新互聯(lián)
網(wǎng)頁地址:http://weahome.cn/article/degdcj.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部