Hi,

That's an invalid JSON string.

Try:

'{
  "nodes": [
    {
      "id": "s1",
      "type": "seminar",
      "title": "Seminar 1",
      "nodes": [
        {
          "id": "c1",
          "type": "course",
          "title": "Kurs 1"
        }
      ]
    },
    {
      "id": "c2",
      "type": "course",
      "title": "Kurs 2"
    }
  ]
}'

You had a syntax error in the above (missing ":"). Also, get in the
habit of quoting yoour keys, that's expected by the spec.

Best,

Tobie

On Dec 20, 12:36 pm, kerthi <[EMAIL PROTECTED]> wrote:
> Hey!
>
> When i try to parse the following Variable with evalJSON() i geht an
> error "Badly formed JSON String"
>
> var string = '{nodes[{id:"s1",type:"seminar",title:"Seminar 1",nodes:
> [{id:"c1",type:"course",title:"Kurs 1"}]},{id:"c2",type:
> "course",title: "Kurs 2"}]};';
>
> why?
>
> regards ck
--~--~---------~--~----~------------~-------~--~----~
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