Hi, I am trying to fetch the LatLon data from a request to Google. The Request.JSONP request works fine and returns the data perfect, but at the onSucces it returns a 'Invalid label' error.
Here is my script:
var G = {}
var googleURL = 'http://maps.googleapis.com/maps/api/geocode/json?address=';
G.google = function(id){
var address = '500-504 W 20th St, New York, NY 10011, USA';
var thisUrl = googleURL + address + '&sensor=true';
new Request.google(thisUrl, {
onSuccess: function(data) {
console.log(data);
}
}).send();
}
Request.google = new Class({
Extends: Request.JSONP,
options: {},
initialize: function(thisUrl, options) {
this.parent(options);
this.options.url = thisUrl;
},
success: function(data, script) {
this.parent(data, script);
}
});
The response looks like:
{
"status": "OK",
"results": [ {
"types": [ "street_address" ],
But then Firebug reports a 'invalid label' error at '"status": "OK",\n'
Anyone got an idea how to solve this problem?
Many thanks.