$.ajax({
url:"http://www.microsoft.com", //请求的url地址
dataType:"json", //返回格式为json
async:true,//请求是否异步,默认为异步,这也是ajax重要特性
data:{"id":"value"}, //参数值 序列化 $("#addForm").serialize(),
type:"POST", //请求方式
beforeSend:function(){
//请求前的处理
},
success:function(req){
//请求成功时处理
},
complete:function(){
//请求完成的处理
},
error: function (xhr, textStatus, errorThrown) {
/*错误信息处理*/
alert("进入error---");
alert("状态码:"+xhr.status);
alert("状态:"+xhr.readyState);//当前状态,0-未初始化,1-正在载入,2-已经载入,3-数据进行交互,4-完成。
alert("错误信息:"+xhr.statusText );
alert("返回响应信息:"+xhr.responseText );//这里是详细的信息
alert("请求状态:"+textStatus);
alert(errorThrown);
alert("请求失败");
}
});
原文链接:https://blog.csdn.net/u012588515/article/details/83021873
拖动 拖动 拖动$('.wrap').dragsort({ drop_exchange:0, itemSelector: 'div', //可拖...
$("input[name=status][value=" + data.status + "]").attr('checked', true);$("input[name=slow_...
网络上流传的ajax解决跨域的方法 $.ajax({ url:"http://crossdomain.com/services.php", dataTyp...
if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]...
利用jquery中is方法判断是否勾选