I use this
var obj = eval( "(" + t.responseText + ")" );
Hope that helps;
On Jun 8, 12:18 am, "Mark Holton" <[EMAIL PROTECTED]> wrote:
> Using Proto 1.5.1:
>
> Let's say my server side code returns a JSON string with is an Array of
> hashes (with name-value pairs), such as in this case, where I return an
> array of 3 hashes via an Ajax.Request invocation:
> [{"VIDID":3359,"VIDPATHSTR":"/SS/vids/123","VIDDESCRIP":"test22"},{"VIDID":3358,"VIDPATHSTR":"
> /SS/vids/123","VIDDESCRIP":"some other descrip"}]
>
> While the following works very nicely for a single JSON object returned...
> doesn't work directly on an array...
> var json = transport.responseText.evalJSON(true);
>
> In Prototype, what's the easiest way to turn that returned JSON string of an
> array of hashes into an object that's accessible via name/value pairs in my
> function?
>
> Many thanks for any words of wisdom!
> cheers,
> Mark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---