title: Get headers Ajax Jquery
body: <p>I try to get the header value "Date" like this but it gives:    </p>
  
  <pre><code>xhr.getResponseHeader is not a function 
  </code></pre>
  
  <p>I see the response header in firebug and it exists :S</p>
  
  <p>Maybe no JQuery support? Can this be done in JavaScript instead maybe? must work, I can see the headers...</p>
  
  <p>Code:</p>
  
  <pre><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;
  }
  </code></pre>
  
  <hr>
  
  <p>Debug dump from firebug, url: www.google.se: </p>
  
  <p>200 OK  92ms    jquery.min.js (line 5)</p>
  
  <p>Response Headers</p>
  
  <pre><code>Alternate-Protocol  80:quic
  Cache-Control   private, max-age=0
  Content-Encoding    gzip
  Content-Type    text/html; charset=UTF-8
  Date    Fri, 09 Aug 2013 00:57:43 GMT
  Expires -1
  P3P CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&amp;answer=151657 for more info."
  Server  gws
  Set-Cookie  PREF=ID=e6503cda76a:FF=0:TM=1376009863:LM=1376009863:S=pByclnZqvnZs2k5S; expires=Sun, 09-Aug-2015 00:57:43 GMT; path=/; domain=.google.se, expires=Sat, 08-Feb-2014 00:57:43 GMT; path=/; domain=.google.se; HttpOnly
  Transfer-Encoding   chunked
  x-frame-options SAMEORIGIN
  x-xss-protection    1; mode=block
  </code></pre>
  
  <p>Request Headers</p>
  
  <pre><code>Accept  */*
  Accept-Encoding gzip, deflate
  Accept-Language en-US,en;q=0.5
  Host    www.google.se
  Origin  http://localhost/
  Referer http://localhost/
  User-Agent  ....
  </code></pre>
  
  <p>console.log(xhr)</p>
  
  <pre><code>[Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js :: .send :: line 5" data: no] { name="NS_ERROR_FAILURE", message="Failure", result=2147500037, more...}
  auto.js (line 52)
  </code></pre>
  
  <p>console.log(output)</p>
  
  <pre><code>Object { readyState=0, status=0, statusText="[Exception... "Failure"...d :: line 5" data: no]"}
  auto.js (line 53)
  </code></pre>
  
  <p>console.log(status)</p>
  
  <pre><code>error
  </code></pre>