Hey there,

  json[@attributes]id  // this doesn't work ;-)

Identifiers in JS cannot start with an @ ($ and _ are allowed), but
you can access them using:

  json.points[0]["@attributes"]

Ciao,
Marc


On Mar 30, 7:35 am, kstubs <[email protected]> wrote:
> I'm getting json back from an ajax request looking something like:
>
> {"@attributes":{"id":"Detail_full_id","name":"Detail_full","threshold":"raw 
> data2"},"point":[{"@attributes":{"fecha":"23-MAR-11","codigo":"23","provinc 
> ia":"Jaen","cantpedsterm":"5","cantlineasser":"151","cantuniser":"
> ...
>
> I'm having trouble in javascript writing the @attributes, so I have
> something like:
>
> json[@attributes]id  // this works
>
> json.points[0]   // this yields an object name "@attributes"
>
> In javascript, this appears to be illegal: json.points[0].@attributes
>
> Any ideas how to deal with @attributes?

-- 
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 [email protected].
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