Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xhr.getResponseHeader is not a function
- 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;
- }
- 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&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
- 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 ....
- [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)
- Object { readyState=0, status=0, statusText="[Exception... "Failure"...d :: line 5" data: no]"}
- auto.js (line 53)
- error
- .always(function(data|jqXHR, textStatus, jqXHR|errorThrown) { });
- .always(function(output, status, xhr) {
- res=xhr.getResponseHeader('Date'); // If response is a success
- res=output.getResponseHeader('Date'); // if response fails
- res= output.getResponseHeader ? output.getResponseHeader.get('Date')
- : xhr.getResponseHeader.get('Date')
Advertisement
Add Comment
Please, Sign In to add comment