$.ajax({
url:'./11.php',
data:{name:'zhang',age:5},//发送数据类型
dataType:'json',//返回数据格式
success:function(msg){
alert(msg);
alert(msg.city);//获取对象内容
}
url:'./11.php',
data:{name:'zhang',age:5},//发送数据类型
dataType:'json',//返回数据格式
success:function(msg){
alert(msg);
alert(msg.city);//获取对象内容
}
})
//11.php ->>url:'./11.php',
<?php
$arr=array('city'=>'山东','mian'=>'960');
echo json_encode($arr);
?>