Today I struggled with the following:
$.ajax({url:'http://maps.google.com/maps/api/geocode/jsonaddress=Karachi&sensor=false&output=json&callback=?',
dataType: 'json',
success: function(data){
alert(data);
}
});
Firefox gives the error message "Invalid label" and "SyntaxError malfunction: Unexpected token": "I found a lot of messages about this, and I tried all kinds of things like eval (), but also:
$.getJSON('http://maps.google.com/maps/api/geocode/jsonaddress=Karachi&sensor=false&output=json&callback=?',
function(data){
alert(data);
}
);
The same result. In addition, other json data works fine, for example flickr (" http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback= ?). So it’s somehow connected with google maps api output i think ..
Thanks in advance.
source
share