How do I convert string to object? I am facing this problem because I am trying to read the elements in the JSON string using \"each\".
My string is given below.
try:
var myjson = '{"TeamList" : [{"teamid" : "1","teamname" : "Barcelona"}]}'; var newJ= $.parseJSON(myjson); alert(newJ.TeamList[0].teamname);