Hi people! I use ColdFusionMX with the JSON-component from http://www.epiphantastic.com/cfjson/ Getting them via Ajax to prototype is no problem, but when i add a recordset to the "RS"-struct, the script returns me this JSON and it doesnt split "id" and "name" into an array... { "TITLE":"Test", "RS": { "recordcount": 5, "columnlist":"id,name", "data": { "id": [1,2,3,4,5], "name": ["Name_1","Name_2","Name_3","Name_4","Name_5"] } } } is there an error in the responseText or does prototype or JS the error? (doesn''t build the data in "id" and "name" arrays?) --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey there, You''ll have to be clearer. I can''t understand what your problem is. The JSON you show does have arrays for the id/name fields... -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi! i tried now even to eval() the responseText and again it doesnt work. if i do alert(jsonObj.RS.data[3].id) i get nothin (neither the alert shows up), but if i do alert(jsonObj.RS.data.id) it gives me an alert with the string "1,2,3,4,5". [ I tried it with IE6 and FF2, so i dont think that is a browser- bug. ] (PS: I''m sorry, my english is bad, i know) On Jun 6, 2:35 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey there, > > You''ll have to be clearer. I can''t understand what your problem is. > The JSON you show does have arrays for the id/name fields... > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
My fault! jsonObj.RS.data.id[0] works, jsonObj.RS.data[0].id doesnt... i thought it''s still like a recordset ;-) Im new to JSON, so... sorry! (But its strange that the call on jsonObj.RS.data.id gives me the array as string) greez and thanks! On Jun 6, 3:06 pm, wiesion <wies...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi! > > i tried now even to eval() the responseText and again it doesnt work. > if i do alert(jsonObj.RS.data[3].id) i get nothin (neither the alert > shows up), > but if i do alert(jsonObj.RS.data.id) it gives me an alert with the > string "1,2,3,4,5". > [ I tried it with IE6 and FF2, so i dont think that is a browser- > bug. ] > > (PS: I''m sorry, my english is bad, i know) > > On Jun 6, 2:35 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > Hey there, > > > You''ll have to be clearer. I can''t understand what your problem is. > > The JSON you show does have arrays for the id/name fields... > > > -- > > Christophe Porteneuve aka TDD > > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---