On Aug 16, 3:42 pm, Terry B <[EMAIL PROTECTED]> wrote:
> query level but that is too cumbersome.  I can't believe JSon does not
> have any options or settings that force all values to strings.  Anyone
> played with this at all?

JSON is a no-logic data interchange format, not a language, so it
neither options nor a way to apply them. While it superficially
appears to be JavaScript, conventions-compliant JSON does not have
access to the full features of JS (e.g. the ability to use a function
as a value). The reason for this is to allow JSON to be used in non-JS
environments (there are parsers implemented in several different
programming languages). There are no directives which suggest to a
JSON parser, "please do [this] or [that]...", in the same way that a
plain text file doesn't have a way to tell a text editor "interpret
characters with the value 0x20 as a vertical bar instead of a space."

In fact you might be able to generate JSON which looks like this:

{ ... val:parseInt('064',10) ... };

and it might work with jQuery's getJSON() (haven't tried it, but i
assume they just eval() the JSON code), but it won't work with JSON
parsers which don't eval() to JSON tree.

Reply via email to