json - How to send cross-domain request to google places api (seems it does'nt support jsonp)? -


i trying make ajax call google places api reviews business no success. using

crossdomain : true,datatype: 'jsonp',

is giving error

uncaught syntaxerror: unexpected token :

i think doesn't support jsonp..is there way it?

thanks

please try following code response google place api

        $.ajax({         type: 'get',         url: 'https://maps.googleapis.com/maps/api/place/autocomplete/json?&input=houston&sensor=true&types=(cities)&key=<your key>',         async: false,         jsonpcallback: 'jsoncallback',         contenttype: "application/json",         datatype: 'jsonp',         success: function (json) {             console.dir(json.sites);         },         error: function (e) {             console.log(e.message);          }     }); 

google responds in form of jsonp callback in place api.kindly replace key in url


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -