GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Line break in timezoneJSON output  XML
Forum Index -> General
Author Message
ibec



Joined: 22/05/2009 14:44:16
Messages: 1
Offline

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
 
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

I have removed the line feed, hope this solves your problem.

Best

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team