Struggling to find the solution for getting the Google Plus +1 of page via jQuery - Ajax from Google's hidden api: https://clients6.google.com/rpc
This issue is also discussed at: Stackoverflow link
My attempt:
$.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);
}
});
With result in chrome: Uncaught SyntaxError: Unexpected token :
And in Firefox:
SyntaxError: missing ; before statement
{"error":{"code":-32700,"message":"Parse Error","data":[{"domain":"g
Any ideas how to solve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…