I was also having same problem then I used the regular javascript eval
function to create an object out of string content
json = '{ "name": "Violet", "occupation": "character" }'
eval("("+json +")")
On May 22, 9:20 pm, oanderson <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm just getting into this and can't seem to get the evalJSON() to
> work.
>
> I'm using the stuff exactly out of the api docs.
>
> <script>
>
> new Ajax.Request('ClientStatusData.jsp', { method:'get',
> onSuccess: function(transport){
> json = '{ "name": "Violet", "occupation":
> "character" }'.evalJSON();
>
> alert(json ? json.name : "no JSON object");
>
> }
> });
> </script>
>
> I just get nothing.
>
> What stupid mistake am I doing?
>
> Prototype 1.5 and Firefox.
>
> thanks for any pointers.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---