I am trying to trigger the Google plus connect API within a jquery/ajax function. The response I get is undefined. Firebug shows an empty response.
This is the code I am using:
function gPlusConnect ()
{
console.debug('line 401 ajax gestartet');
result=$.ajax({
type: 'POST',
async: false, // false
url: 'https://accounts.google.com/o/oauth2/auth',
data: ({
scope:'https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile',
state:'/profile',
redirect_uri:'https://ssl.webpack.de/learnface.de/donation/launchpages',
response_type:'code',
client_id:'.........82.apps.googleusercontent.com',
})
}).responseText;
console.debug('index.php 415 ajax ends with '+result+' from g+');
}
The result in firebug is:
Header Post Antwort HTML
index.php 415 ajax ends undefined from g+
Has anyone done this successfully? Do you recommend a better alernative?