Guest User

Untitled

a guest
Sep 2nd, 2013
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. xhr.getResponseHeader is not a function
  2.  
  3. function ajaxDate(myUrl){
  4. var res;
  5. var ajaxCall=$.ajax({
  6. type: 'GET',
  7. url: myUrl,
  8. crossDomain: true,
  9. async: false,
  10. cache: false
  11. }).always(function(output, status, xhr) {
  12. //alert(xhr.getResponseHeader("MyCookie"));
  13. console.log(xhr);
  14. console.log(output);
  15. console.log(status);
  16. res=xhr.getResponseHeader('Date');
  17. });
  18. return res;
  19. }
  20.  
  21. Alternate-Protocol 80:quic
  22. Cache-Control private, max-age=0
  23. Content-Encoding gzip
  24. Content-Type text/html; charset=UTF-8
  25. Date Fri, 09 Aug 2013 00:57:43 GMT
  26. Expires -1
  27. P3P CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
  28. Server gws
  29. 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
  30. Transfer-Encoding chunked
  31. x-frame-options SAMEORIGIN
  32. x-xss-protection 1; mode=block
  33.  
  34. Accept */*
  35. Accept-Encoding gzip, deflate
  36. Accept-Language en-US,en;q=0.5
  37. Host www.google.se
  38. Origin http://localhost/
  39. Referer http://localhost/
  40. User-Agent ....
  41.  
  42. [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...}
  43. auto.js (line 52)
  44.  
  45. Object { readyState=0, status=0, statusText="[Exception... "Failure"...d :: line 5" data: no]"}
  46. auto.js (line 53)
  47.  
  48. error
  49.  
  50. .always(function(data|jqXHR, textStatus, jqXHR|errorThrown) { });
  51.  
  52. .always(function(output, status, xhr) {
  53.  
  54. res=xhr.getResponseHeader('Date'); // If response is a success
  55.  
  56. res=output.getResponseHeader('Date'); // if response fails
  57.  
  58. res= output.getResponseHeader ? output.getResponseHeader.get('Date')
  59. : xhr.getResponseHeader.get('Date')
Advertisement
Add Comment
Please, Sign In to add comment