[Mapbender-dev] JSON revisited

Christoph Baudson (WhereGroup) christoph.baudson at wheregroup.com
Thu Jan 18 10:37:12 EST 2007


Hi there,

>> Because the native JSON support in PHP has only just begun in version 
>> 5.2, we are experimenting with JSON-PHP, see
>>
>> http://mike.teczno.com/json.html
> 
> according to http://gggeek.altervista.org/sw/article_20061113.html this 
> is a reosonable choice... so let's just try it.

Thanks for your input Marc. Let's stick with this one until something 
better comes up.

>> Because JSON overloads several JS datatypes, some conflicts emerge. 
>> For example, for (var attribute in object) suddenly doesn't work 
>> anymore because it has an additional attribute: the JSON functions :-)
> 
> Is this the case? That's new to me... but the whole (actual) JSON coding 
> is new to me ;-)
> 
> How often do we use
> for ... in
> though?

The Json library adds function like "toJsonString" to data types like 
Array. So if you have associative arrays you can't use the

for (var x in y)

anymore, because the function is part of the array. Well, there aren't 
many situations where this construction is used in Mapbender, but maybe 
this advice is helpful to someone someday.

Cheers,

Christoph


More information about the Mapbender_dev mailing list