My code is like below
$.ajax({
url: "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&type=" + type +"&keyword=cruise&key=[Myapikey]",
type: "GET",
dataType: 'json',
cache: false,
success: function(response){
debugger;
alert(response);
}
});
Error: “Uncaught SyntaxError: Unexpected token :”
if i use json instead of jsonp as the data type then
Error: “No ‘Access-Control-Allow-Origin’ header is present on the requested resource”
Any one have the solution for this.