[Proto-Scripty] Re: Help with xml attributes in json object

2011-04-02 Thread kstubs
Good to know. Thanks. -- 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 prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to

[Proto-Scripty] Re: Help with xml attributes in json object

2011-03-31 Thread Marc
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 kst...@gmail.com wrote: I'm getting json back from an ajax request

[Proto-Scripty] Re: Help with xml attributes in json object

2011-03-31 Thread ColinFine
In Javascript, you can always use the array-name[expression] form, such as json.points['@attributes']; The array-name.id form is precisely equivalent to array-name[id] *provided id is a valid javascript identifier*. Otherwise the latter is invalid. Colin -- You received this message because