Get response headers cross domain

Get response headers cross domain

How can I get the response headers when making a cross domain request? xhr.getAllResponseHeaders() just returns null.

  1. $.ajax({
  2. url: 'http://search.twitter.com/search.atom?q=foo',
  3. success: function(data, textStatus, xhr){
  4. alert("Success:\ntextStatus: " + textStatus + "\nxhr: " + xhr.getAllResponseHeaders());
  5. },
  6. error: function(xhr, textStatus, errorThrown) {
  7. alert("Error:\nxhr:" + xhr.getAllResponseHeaders() + "\ntextStatus: " + textStatus + '\nerrorThrown: ' + errorThrown);
  8. }        
  9. });

I especially need to get the value of the "Retry-After" response header when twitter issues an HTTP 420 response code. See more on twitter's rate limiting here:  http://dev.twitter.com/pages/rate-limiting

Thanks, hope you can help :)