By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,805 Members | 1,349 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,805 IT Pros & Developers. It's quick & easy.

json 2 arrays in one object

P: 1
hello to all,

I try to put two arrays inside one json object in javascript. But it's not working.

here my code:

Expand|Select|Wrap|Line Numbers
  2.   var txt = '{"event":["group1":["player1":[{"name":"markus", "age":"34"}]]]}';      
  4.                     obj = JSON.parse(txt);
My goal is to store the details of a player in a array and than to store the player in a specific group.

Thanks for any help !
Apr 6 '12 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 127
It is not a Java question but anyway.
Expand|Select|Wrap|Line Numbers
  1. var txt = '{"event":{"group1":[{"player1":{"name":"markus", "age":"34"}}]}}'; 
  2. obj = JSON.parse(txt);
Apr 9 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.