GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
error with nearbyplacename  XML
Forum Index -> General
Author Message
nicarcola



Joined: 06/02/2007 12:13:27
Messages: 26
Offline

I use the following request
request = 'http://ws.geonames.org/findNearbyPlaceNameJSON?lat=' + puntlocatielat + '&lng=' + puntlocatielng + '&callback=getLocation';

when the lat and lng point for example to greenland than I get the following error in my callback:
name is empty or no object.

The callback looks like this:
if (jData != null) {
var place = jData.geonames[0];
puntstad = place["name"];
puntprovincie = place["adminName1"];
puntland = place["countryName"];
puntlandcode = place["countryCode"];
}
...

I can imagine that there is no city out there, but is it possible that I can pick up this error, because now I get a blank page and the indication that there is an error. Do I have to check an errorcode??? How and what?
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team