Parsing JSON with eval

Posted by Neethusha on Stack Overflow See other posts from Stack Overflow or by Neethusha
Published on 2010-03-19T12:06:12Z Indexed on 2010/03/19 12:11 UTC
Read the original article Hit count: 282

Filed under:
|

I have this code:

function useHttpResponse() 
{

 if (xmlhttp.readyState==4 )
 {
 var response = eval('('+xmlhttp.responseText+')');
  alert(response);
 for(i=0;i<response.Users.length;i++)
        alert(response.Users[i].UserId);

 }
}

When i alert, the first alert is "[object Object]"

Why is that so? I need to remove that...how?

© Stack Overflow or respective owner

Related posts about JSON

Related posts about JavaScript