ajax :请求 响应
js
穿件ajax对象
var xhr = XMLHttprequest();
监听ajax状态
发起请求
xhr.open('get','fwq.php?name=zhangsan&age=123')
传数据
xhr.sen(null);
jquery
$.ajax({
async:true
url:"",
data:{name:"zhangsan",age:12}
type:"post"
datatype:"text",
sunccess:function(data){
}
});
//jQuery
$.ajax({
async:true,
url:"fwq.php",
data:{name:"zhangsan",age:12},
type:'post',
dataType:'text',
success:function(data){
}
});
$.ajax({
async:true,
url:"fwq.php",
data:{name:"zhangsan",age:12},
type:'post',
dataType:'text',
success:function(data){
}
});