我正在使用jQuery发送HTTP请求。下面是代码。我想获取HTTP请求的状态代码。
有谁知道,如何获得状态?
$(document).ready(function(){
var url="http://www.google.com";
$.get(url, function(data,status) {
alert(status);
// This doesn't alert me status
// I want to alert request status code as "200" i.e. ok
});
// on Failure also need the status code of this request.
});
答案 0 :(得分:3)