On Oct 31, 2008, at 11:37 AM, T.J. Crowder wrote:

>> Does JSON really have to be all one long line of text?
>
> No, not according to the specs[1]: "Whitespace can be inserted between
> any pair of tokens".  I've definitely used newlines in real-world apps
> using Prototype's built-in handling for JSON response bodies in
> Ajax.Requests.
>
> Just tested, and this worked fine:
> * * * *
>     var s;
>     var j;
>
>     s = "\n{\n'test'\n:\n'value'\n}\n";
>     j = s.evalJSON();
>     alert("j.test = " + j.test);
> * * * *
>
> Tested in FF3, IE6, Op9, Safari3 (Windows).
>
> I think the problem must lie elsewhere.

Correct, as usual. Another function was occasionally double-escaping  
single-quotes, and that was throwing the wrench in the works.

Thanks again,

Walter
>
> [1] http://json.org


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to