Sunday, 15 March 2015

jquery - SyntaxError: missing ; before statement Getting this error when trying to call google place search api -



jquery - SyntaxError: missing ; before statement Getting this error when trying to call google place search api -

getting 'syntaxerror: missing ; before statement' error when trying run ajax code fetch atm within 1 km range.

var url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json"; jquery.ajax({ url: url, datatype: 'jsonp', data: { 'location': '-33.8670522,151.1957362', 'radius': 1000, 'types': 'atm', 'name': '', 'sensor': false, 'key': api_key }, success: function(response) { alert('success'); } });

i have searched many articles didnt found solution. if remove 'p' 'jsonp' there no response cause cross domain. how can solve issue?

there no syntax-error in code, error comes via response.

the places-webservice doesn't back upwards jsonp, can't request service via $.ajax

use methods of places-library of maps-javascript-api: https://developers.google.com/maps/documentation/javascript/places#place_search_requests

jquery json google-maps-api-3 google-places-api

No comments:

Post a Comment