1
我试图在jQuery/ajax函数中触发Google plus connect API。 我得到的回应是未定义的。 Firebug显示一个空的回应。Google Plus使用jQuery/Ajax连接API
这是代码我使用:
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+');
}
结果在Firebug是:
Header Post Antwort HTML
index.php 415 ajax ends undefined from g+
有没有人成功地做到了这一点?你推荐一个更好的环境吗?