更新时间:2022-03-03 22:46:30
为了与XMLHttpRequest向后兼容,将使用jqXHR对象 公开以下属性和方法: getAllResponseHeaders() 和 getResponseHeader(). 从$ .ajax()文档中: http://api.jquery.com/jQuery.ajax/ >
For backward compatibility with XMLHttpRequest, a jqXHR object will expose the following properties and methods: getAllResponseHeaders() and getResponseHeader(). From the $.ajax() doc : http://api.jquery.com/jQuery.ajax/
对于jQuery> 1.3
For jQuery > 1.3
success: function(res, status, xhr) {
alert(xhr.getResponseHeader("myHeader"));
}