I am trying to use JSONP to get around the same origin policy, but as far as I understood, I have the mentioned error because the server is not actually returning a JSONP response. But if I use json as my dataType then I get an "XMLHttpRequest cannot load, No 'Access-Control-Allow-Origin' header is present on the requested resource" Here is my code:
$.ajax({
url : "https://maps.googleapis.com/maps/api/place/nearbysearch/json? location=-33.86,151.195&radius=5000&type=ATM&keyword=ATM&key=MyAPIKey",
type : "GET",
dataType: 'jsonp',
success:function(data){
console.log(data);
}
})
A similar problem can be found here [json Uncaught SyntaxError: Unexpected token : ] but only served to understand what is going on rather than solving the problem. I am relatively new to this so please I will appreciate a step-by-step guide to solving this.
Having same problem on chrome and firefox.