jQuery成功,访问HTTP状态文本

Pas*_*yer 0 javascript jquery

如果邮件调用成功,我如何访问从服务器返回的原始HTTP状态文本.对于错误,方法中有选项errorThrown .error.是否有模拟参数.success?

码:

  $.post(UI.SelectionList.settings.leftReturnURL, {
      delegateId: $(this).data('id')
  }, function (data, text, xhr) {}).success(function() {
      console.log(arguments);
  });
Run Code Online (Sandbox Code Playgroud)

控制台输出:

["", "success", Object] //Object is the jqXHR object, statusText inside is also "success" 
Run Code Online (Sandbox Code Playgroud)

Esa*_*ija 6

$.ajax({
    url: "/",

    success: function(data, textStatus, jQXHR) {
        console.log(jQXHR.status, jQXHR.statusText);
        //200 "OK"
    }
});
Run Code Online (Sandbox Code Playgroud)