title: json parse error - Uncaught TypeError: Cannot use 'in' operator to search for '1009'
body: <p>I'm developing an application which does an Ajax call to a PHP script which returns <code>json_encode</code> data.</p>
  
  <p>The data is being returned from PHP as expected. But when trying to parse it in jquery I'm getting a console error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot use 'in' operator to search for '1009'</p>
  </blockquote>
  
  <p>followed by a copy of my data array.</p>
  
  <p>An example of the json encoded data is here:</p>
  
  <pre><code>[
  {"u_id":"21747","fname":"Andy","lname":"","email":"foo@bar.com"},
  {"u_id":"3748","fname":"John","lname":"","email":"foo@baz.com"},      
  {"u_id":"451750","fname":"Peter","lname":"","email":"someone@else.com"},
  ]
  </code></pre>
  
  <p>The jquery I'm using is as follows. The desired output is for it to display a list of people's email addresses next to a tickbox:</p>
  
  <pre><code>$(function() {
      $('#myModal').on('shown.bs.modal', function() {
          $(".modal-body").html("Loading...");
              $.ajax({
                  url: "&lt;?= $router-&gt;pathFor('/admin/ajax/find-user'); ?&gt;",
                  data: {
                      searchInput: $('#searchInput').val()
                  },
                  method: "POST",
            }).done(function(data) {
               //$(".modal-body").html(data);
               $.parseJSON(data);
               $.each(data, function(key, value){
                   $(".modal-body").html('&lt;input type="checkbox" id="' + value.u_id + '"&gt;' + value.email + "&lt;br&gt;");
            });
        });
      });
  });
  </code></pre>
  
  <p>What's wrong with this, and what does the error mean (I can't see 1009 anywhere in my data, although not sure if that's what it actually means?)</p>