I'm retrieving the timezone and current timestamp in a web page via JSONP. But this fails due to a line break / empty line at the end of the timezoneJSON response. Why is there a line break / empty line anyway at the end of the JSON response? Or is there a way to bypass this? Here's the code snippet I'm using:
http://ws.geonames.org/timezoneJSON?lat=51.55&lng=4.8
Code:
var time_geoplaces_url = "http://ws.geonames.org/timezoneJSON?lat=" + geo_lat + "&lng=" + geo_lon;
var time_geoplaces = dojo.io.script.get({
"url":time_geoplaces_url
});
console.log(time_geoplaces_url);
console.log(time_geoplaces);
Error:
Code:
invalid label
[Break on this error] {"time":"2009-05-22 14:54","countryName"...zoneId":"Europe/Amsterdam","lat":51.55}\n