1、 get方式
$.get(url,{},function(){ },'类型html xml json')
$.get('url?name='+name,function(){ },'类型html xml json')
2、 getJSON方式
$.getJSON(url,{},function(){ })
3、post()
$.post(url,{},function(){ },'请求类型')
4、ajax()方式
$.ajax({
type:'get/post',
url:'地址',
async:true/false,//判断是否是异步
// data:'uname=name&password=pwd',
data:{
uname:name
},
dataType:'数据类型json xml html jsonp',
success:function(data){
//请求成功
},
error:function(err){
//请求失败
},
beforeSend:function(){
//ajax发送请求前
},
complete:function(){
//完成后之前
}
})