I’m using this jQuery AJAX call to google’s ClientLogin.
$.ajax({ url:"https://www.google.com/accounts/ClientLogin",
type:"POST",
data:{'Email': 'myusername',
'Passwd': 'mypassword',
'service': 'fusiontables',
'accountType': 'HOSTED_OR_GOOGLE'},
dataType:"jsonp",
success:function(data){ console.log("Hurrah!"); },
error:function(e){ console.log(e); }
});
The problem is, ClientLogin does not return a JSON, rather a text/plain. So I get the following error:
SID=blahblah
LSID=blahblah
Auth=blahblah
ClientLogin:3 Uncaught SyntaxError: Unexpected token ILLEGAL.
How can I parse this response and get the Auth= value?
JSON-P wraps data in JavaScript to get around the same origin policy
You can’t read arbitrary data from third party websites with client side JavaScript.
Proxy the data through your own server if you want it.