我有一个通过 ajax 提交的表单。我正在使用 jquery 表单插件。我想要做的是获取从我的服务器返回的“位置”标头。我可以在萤火虫中看到它。但是每当我在成功回调中调用 getResponseHeader() 函数时,它总是返回“未定义”。
代码:
form.ajaxForm({
dataType: 'xml',
data: {format: 'xml'},
resetForm: true,
success: function(xml,status,xhr){
var location = xhr.getResponseHeader('Location');
alert(location);
});
位置未定义。但我可以在萤火虫中看到“位置”标题。我错过了什么?即使我从 xhr 对象调用 getAllResponseHeaders(),它也会返回“未定义”