title: Jquery - Uncaught TypeError: Cannot use 'in' operator to search for '324' in
body: <p>I'm trying to send a Get request by ajax and output json data that is returned by server in html.</p>
  
  <p>But, I got this error.</p>
  
  <pre><code>Uncaught TypeError: Cannot use 'in' operator to search for '324' in 
  [{"id":50,"name":"SEO"},{"id":22,"name":"LPO",}]
  </code></pre>
  
  <p>This is my code that sends a Get request to php file by ajax.
  When I use $.each method, it get the error that I showed in the above.</p>
  
  <pre><code>parentCat.on('change', function(e){
      parentCatId = $(this).val();
  
      $.get(
          'index.php?r=admin/post/ajax',
          {"parentCatId":parentCatId},
          function(data){                     
              $.each(data, function(key, value){
                  console.log(key + ":" + value)
              })
          }
      )
  
  })
  </code></pre>
  
  <p>This is my PHP code that returns query result in json format.</p>
  
  <pre><code>public function actionAjax(){
  
      $parentCatId=$_GET['parentCatId'];
  
          $catData = Category::getTargetCategoryData($parentCatId);
  
          echo CJSON::encode($catData);
          Yii::app()-&gt;end();
  
  }
  </code></pre>
  
  <p>json data outputted by this php is like this.</p>
  
  <pre><code>[{"id":50,"name":"SEO"},{"id":22,"name":"LPO",}]
  </code></pre>
  
  <p>Anyone knows how to fix this problem?</p>
  
  <p>Please help me out.
  Thanks in advance :)</p>