title: $.jquery .post returned data (json) as 'undefined'
body: <p>Got this problem and really dunno why shows undefined :(( Please help me figure it out! Thanks!!!</p>
  
  <pre><code>&lt;script&gt;$( "select" ).change(function() {
    var name = $('select#usersfromhell').val();
    $.post('dynamicselect.php', {name: name}, function(data) {
  
        var jsonString =JSON.stringify(data);
        var obj = JSON.parse(jsonString);
        alert(obj.jmeno); // here shows undefined!!!!
        $('input#name').val(jsonString); // but here correctly fill the input value --- "{\"jmeno\":\"http:\\/\\/www.jobs.cz\"}"
    });
  });&lt;/script&gt;
  </code></pre>
  
  <p>dynamicselect.php</p>
  
  <pre><code>$users-&gt;get('users', array('username', '=', $_POST['name']));
  
  foreach($users-&gt;results() as $user) {
  
      //echo $user-&gt;name ." ". $user-&gt;joined . " " . $user-&gt;group;
      echo json_encode(array("jmeno" =&gt; $user-&gt;name)); // "{\"jmeno\":\"http:\\/\\/www.jobs.cz\"}"
  }
  </code></pre>
  
  <p>Thanks!</p>