title: Uncaught TypeError: Cannot use 'in' operator in jquery/json
body: <p>I create a json in php like this:</p>
  
  <pre><code>$details= array();
  $ret = array();
  
  for($i=0;$i&lt;3;$i++) { $details["name"] = "name".$i;  $ret[] = $details;}
  </code></pre>
  
  <p>And then return it to a jquery ajax:</p>
  
  <pre><code>echo json_encode($ret,JSON_UNESCAPED_UNICODE);
  die();
  </code></pre>
  
  <p>In jQuery ajax:</p>
  
  <pre><code>$.ajax({
      url: "index2.php?id=upload",
      type: "POST",
      data:  new FormData($("#form")[0]),
      contentType: false,
      cache: false,
      processData:false,
      returnType:"json",
      success: function(data)
      {
          console.log('names:'+JSON.stringify(data));
          $.each(data, function(i) 
          { 
              console.log('name:'+data[i]['name']);
           }
      },
  </code></pre>
  
  <p>first console log prints,but second:
  I get this error:</p>
  
  <blockquote>
    <p>jquery-2.2.3.min.js:2 Uncaught TypeError: Cannot use 'in' operator to
    search for 'length' in
    [{"name":"name1"},{"name":"name2"},{"name":"name3"}]</p>
  </blockquote>
  
  <p>Also I try</p>
  
  <pre><code>$.each(JSON.parse(data), function(i) 
                  { ..}
  </code></pre>
  
  <p>but I  print empty: </p>
  
  <blockquote>
    <p>name:undefined</p>
  </blockquote>