I was having a similar problem and the only solution I could come up
with is to use an eval (which admittingly, I don't like to use if at
all possible).

This should work:

var jsonStr = '{"Success":true,"Success_Message":"Yay, PHP script
returned something..."}';
var Results = eval('(' + jsonStr + ')');

Hope that helps! Cheers!

On Feb 24, 11:59 am, "RFLudwick" <[EMAIL PROTECTED]> wrote:
> I'm having trouble dealing with my server response using Prototype
> 1.5. My server is returning the results of Ajax queries in JSON (An
> array) and I need to eval() that in my Ajax.Request onSuccess.
> Unfortunately, I cannot find a way to do so.
>
> How can I get something like this:
>
> {"Success":true,"Success_Message":"Yay, PHP script returned
> something..."}
>
> into an array var in my Ajax.Request that would read like so:
>
> Results["Success"]
> Results["Success_Message"]
>
> Thanks.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to