javascript - Google's Places API and JQuery request - Origin http://localhost is not allowed by Access-Control-Allow-Origin -
I am doing some testing for a project which I am kept in mind that includes nearby places Use is included. That's why I went with a big man and started roaming with Google's APA. I have been using the booklet with openstreet tiles for my map. Until now I do not try to use Dang, it is all right. Thank you! You are trying to use it, Output does not support which you need JavaScript. In Javascript, you need to use that you can not directly click the URL directly from the Javascript or jQuery code. (You may be it ) that the url pattern is used to search the site library, but the terms of service do not permit access directly through the API / Library, and the URL Time can also change.) Is there any reason why you do not want to use Maps API from javascript? var lat = coords.lat; Var lng = coords.lng; Var apiUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json"; Var Data = {Key: 'Aja Sebel 8 BME 8 QT 7 Arjo XHP6's 2D D44 H9-FSUI', Location: Latitude + ',' + LNG, Radius: '10000', Sensor: 'False' Rank: 'prominence', type: 'bar' Night club '}; $ AJAX ({url: API URL, type: 'post', data: data, datatype: "jsnp", crossderman: true, success: function (data) {var obj = $ .parseJSON (data); // console log .next_page_token);}}); Allow me access to
origion http: // localhost by changing
dataType property to
json - the original . I get a parsing error using jsonp
unexpected token: Obviusly
$. ParseJSON does not work ... Is there any way to do this without using Google Maps API? If there is no answer ... is Google another API as well?
Comments
Post a Comment