1
我想用我的刷新获得通过JavaScript访问令牌访问令牌token.So这是我的代码:获得通过javascript
$.ajax({
type: "POST",
contentType: "application/x-www-form-urlencoded",
url: "https://accounts.google.com/o/oauth2/token",
data: "client_id=" + CLIENT_ID + "&client_secret=" + CLIENT_SECRET + "&refresh_token=" + REFRESH_TOKEN + "&grant_type=refresh_token",
dataType: "json",
success: function (data) {
alert(data.d);
}
});
但我不明白谷歌返回400错误的请求。请帮我
这是违反相同的来源政策 –
尝试在Chrome中使用开发人员工具(ctrl + shift + i)在网络选项卡中查看您的请求来运行此操作,这是调试此类内容的好方法。 –