第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

不報(bào)錯(cuò) 也什么都不顯示

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>使用get()GET方式從服務(wù)器獲取數(shù)據(jù)</title>

<script type="text/javascript" src="lib/jquery-3.3.1.min.js">

</script>

</head>

<!--

? ? 使用get()方法時(shí),采用GET方式向服務(wù)器請(qǐng)求數(shù)據(jù),并通過(guò)方法中回調(diào)函數(shù)的參數(shù)返回請(qǐng)求的數(shù)據(jù),

? ? 它的調(diào)用格式如下:

$.get(

? ? "發(fā)送的請(qǐng)求地址" ,

? ? 要發(fā)送的數(shù)據(jù) key/value ,?

回調(diào)函數(shù) ,

"返回內(nèi)容格式,xml, html, script, json, text "

);


? ? -->

<body>

<div>

<div>

<span>我的個(gè)人資料</span>

<span>

<input type="button" value="加載" id='jia' />

</span>

</div>

<ul></ul>

</div>

<script type="text/javascript">

$(function (){

$('#jia').bind('click',function(){

var $this = $(this);

$.get('new_file.php',function(date){

$this.attr('disable','true');

$('ul').append("<li>我的名字叫:"+date.name+"</li>");

$('ul').append("<li>男朋友對(duì)我說(shuō):"+date.say+"</li>");

//返回內(nèi)容格式,xml, html, script, json, text?

},"script");

});

});

</script>

</body>

</html>


info.php文件


<?php

echo json_encode(array("name"=>"土豪","say"=>"咱們交個(gè)朋友吧"));

?>


正在回答

2 回答

new_file.php ???你文中不是這樣:

info.php文件


<?php

echo json_encode(array("name"=>"土豪","say"=>"咱們交個(gè)朋友吧"));

?>


0 回復(fù) 有任何疑惑可以回復(fù)我~

$.get('new_file.php',function(date){

$this.attr('disable','true');

$('ul').append("<li>我的名字叫:"+date.name+"</li>");

$('ul').append("<li>男朋友對(duì)我說(shuō):"+date.say+"</li>");

//返回內(nèi)容格式,xml, html, script, json, text?

},"script"); ? 加粗部分 只要改成json就不顯示 ?改成其他的 就?undefined


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
jQuery基礎(chǔ)(五)一Ajax應(yīng)用與常用插件
  • 參與學(xué)習(xí)       69100    人
  • 解答問(wèn)題       416    個(gè)

如何用jquery實(shí)現(xiàn)ajax應(yīng)用,加入學(xué)習(xí),有效提高前端開(kāi)發(fā)速度

進(jìn)入課程

不報(bào)錯(cuò) 也什么都不顯示

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)