jquery中ajax使用详细

来源:互联网 发布:nasa数据查询 编辑:程序博客网 时间:2024/05/16 13:53

$.ajax({
url: url, //请求的url地址
dataType: “json”, //返回格式为json
async: true, //请求是否异步,默认为true异步,这也是ajax重要特性
data: { id: id }, //参数值
type: “post”, //请求方式
beforeSend: function() {
//请求前的处理
},
success: function(data) {
//请求成功时处理
},
complete: function() {
//请求完成的处理
},
error: function() {
//请求出错处理
}
});

参考链接:http://www.php100.com/html/program/jquery/2013/0905/6004.html

0 0