Ruth_Lang
(Ruth Lang)
June 21, 2010, 5:12pm
#1
Hi,
I just play around with Nominatim
http://wiki.openstreetmap.org/wiki/Nominatim
with format=json
The objects I get, have the attribute class (values: place, boundary…)
Now I have the problem that I can’t address this attribute because class is a reserved word in Javascript…
Has anybody a solution for this?
Thanks
Ruth
Ruth_Lang
(Ruth Lang)
June 22, 2010, 8:32am
#2
Hi,
eval(“obj.class”) helps…
Ruth
Ruth_Lang
(Ruth Lang)
June 22, 2010, 9:08am
#3
Hi,
still not works in IE…
Only idea I have:
for (var part in obj) {
if (part == “class”) {
alert(obj[part]);
}
}
No better idea?
– Ruth
twain
June 22, 2010, 11:12pm
#4
use
format=jsonv2
which renames class to category
And I’ll go and document the fix - it’s been there for a while!