相关疑难解决方法(0)

通过AJAX获取谷歌+1页面分享(隐藏的Api)

努力寻找通过jQuery 获取Google Plus +1页面的解决方案- 来自Google隐藏的API的Ajax:https://clients6.google.com/rpc

此问题也在以下讨论:Stackoverflow链接

我的尝试:

$.ajax({
    cache: false,
    type: "POST",
    url: "https://clients6.google.com/rpc",
    data: [{
        "method":"pos.plusones.get",
        "id":"p",
        "params":{
            "nolog":true,
            "id":"http://www.apple.com",
            //"id":"http%3A%2F%2Fwww.apple.com",
            "source":"widget",
            "userId":"@viewer",
            "groupId":"@self"
            },
            "jsonrpc":"2.0",
            "key":"p",
            "apiVersion":"v1"
    }],
    crossDomain: true,
    jsonp: true,
    timeout: 5000,
    dataType: "jsonp",
    contentType: "application/json; charset=utf-8",
    success: function (data) {
        console.log(data);
    },
    always: function(data){
        console.log(data);
    }
});
Run Code Online (Sandbox Code Playgroud)

结果为chrome:Uncaught SyntaxError:意外的令牌:

在Firefox中:SyntaxError:missing; 在声明之前

{"error":{"code": - 32700,"message":"Parse Error","data":[{"domain":"g

任何想法如何解决这个问题?

ajax jquery cross-domain google-plus

2
推荐指数
1
解决办法
7207
查看次数

标签 统计

ajax ×1

cross-domain ×1

google-plus ×1

jquery ×1