After SQL API was deprecated searching solution to migrate from SQL API
https://www.google.com/fusiontables/api/query?sql= to https://www.googleapis.com/fusiontables/v1/query?sql= like here
I got:
var URLHead = 'https://www.google.com/fusiontables/api/query?sql='
var URLTable = encodeURI('SELECT id,COUNT() FROM TABLE_ID')
var URLTail = '&access_token='+ TOKEN +'&jsonCallback=?'
var queryURL = URLHead + URLTable + URLTail
var jqxhr = $.get(queryURL, myFT.TABLE, "jsonp")
this.myFT.TABLE = function (DATA) {
var counter = parseInt(DATA.table.rows[0].toString().substr(1))
alert(counter )
}
I need:
var URLHead = 'https://www.googleapis.com/fusiontables/v1/query?sql='
var URLTable = encodeURI('SELECT id,COUNT() FROM TABLE_ID')
var URLTail = '&access_token='+ TOKEN +'&jsonCallback=?'
var queryURL = URLHead + URLTable + URLTail
var jqxhr = $.get(queryURL, myFT.TABLE, "jsonp")
this.myFT.TABLE = function (DATA) {
var counter = parseInt(DATA.table.rows[0].toString().substr(1))
alert(counter )
}
Looks like it’s not so easy to migrate from SQL API to /fusiontables/v1/ for me.
EDIT:
1. Try to change the jsonCallback to callback – not helped!
Finaly! Found pure and simple solution by replacing jQuery examp. with google-api-javascript-client
Don’t forget to add into head tag
<script src="https://apis.google.com/js/client.js?onload=load"></script>EDIT:
Or simply just like in first example above change this
var URLTable = encodeURI('SELECT id,COUNT() FROM TABLE_ID')to this
var URLTable = encodeURI('SELECT COUNT() FROM TABLE_ID')