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

problem with converting json string to json object using eval

P: 6
i have a problem converting a json string that i get from a servlet into a json object using eval function of java script. any one please help me..........
Jun 20 '07 #1
Share this Question
Share on Google+
2 Replies


gits
Expert Mod 5K+
P: 5,320
hi,

please be a little bit more specific ;) ... what is the problem?

kind regards ...
Jun 20 '07 #2

rnd me
Expert 100+
P: 427
Expand|Select|Wrap|Line Numbers
  1. var jsonString="{a:1,b:2,c:3}"
  2.  
  3. var jsonObj=eval (  "  (  " + jsonString + "  )  " );
  4.  
  5. alert(jsonObj.b) //alerts "2".
Jun 21 '07 #3

Post your reply

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