Get headers Ajax Jquery
I try to get the header value "Date" like this but it gives:
xhr.getResponseHeader is not a function
I see the response header in firebug and it exists :S
Maybe no JQuery support? Can this be done in JavaScript instead maybe?
must work, I can see the headers...
Code:
function ajaxDate(myUrl){
var res;
var ajaxCall=$.ajax({
type: 'GET',
url: myUrl,
crossDomain: true,
async: false,
cache: false
}).always(function(output, status, xhr) {
//alert(xhr.getResponseHeader("MyCookie"));
console.log(xhr);
console.log(output);
console.log(status);
res=xhr.getResponseHeader('Date');
});
return res;
}
No comments:
Post a Comment