JSON is a simple exchange-format for datastructures. It is widely used when 'ajaxing' the web, because it bypasses the XML layer of the underlying XMLHTTPRequest.
But - be prepared to run in problems when using JSON. JSON adds methods to all Objects and Arrays (using the prorotype's of Array, String and Object). So you have to be prepared to see functions like “toJSONString” when iterating over members.
Especially the for-each loop on arrays might crash. The following loop iterates over the array's elements.
<script src=”/js/json.js” />
<script>
var names = [ 'foo','bar' ];
for each ( f in names ) {
alert( f );
}
</script>
Running this script in a browser will show you foo,bar and toJSONString - this is probably not what you are expecting!
To avoid errors in your application, you have to check the members type - but this will break the elegance of the for-each loop
.