title: Iterate through Json array
body: <p><strong>Edit</strong>
  This is the function where I get the response from</p>
  
  <pre><code>$(document).ready(function()
  {
  
    $.ajax({
      method: "get",
      url: 'ctr_seearmylist.php',
      dataType: 'jsonp',
      data: 'get=squad',
      success: processSquads
    });
  
  });
  </code></pre>
  
  <p>and this is the php snippet that creates the response:</p>
  
  <pre><code>{..... //iterates throuh a result taken from the database
    $temp[0]=$id;
     $temp[1]=$squad_id;
     $result[]=$temp;
    }
    $result=json_encode($result);
    }
  return $result;
  }
  </code></pre>
  
  <p>if i call alert(response.constructor);
  I get</p>
  
  <pre><code>function Array() {
      [native code]
  }
  </code></pre>
  
  <p><strong>End Edit</strong></p>
  
  <p>How do I iterate through a json array using jquery or javascript, or whatever works?</p>
  
  <p>the json response i get has this form: [["1","12"],["2","3"],["3","7"]]</p>
  
  <p>I should mention that using response.length; has no effect</p>
  
  <pre><code>function processSquads(response)
  {
    alert (response[0][0]); // works and returns 1 
    alert (response[0]); // works and returns 1,12
    alert (response.length); //doesn't work so I can't iterate 
  }
  </code></pre>
  
  <p>Sorry for the large number of questions today, but I'm just getting started with Ajax and I get stuck.</p>