私のPHPスクリプト
<?php
//connect to server
//selecting the database
$temparr=array();
$count=0
$result = mysql_query("some query");
while($row = mysql_fetch_assoc($result))
{
   $temparr["$count"]= $row["value"] ;
   $count+=1;
}
echo json_encode($temparr);
mysql_close($conn); 
?>
私のjavascriptファイルのAJAX関数呼び出しは次のとおりです
function someFunction(){
  xmlhttp = new XMLHttpRequest();
  xmlhttp.open("GET", "mymethodpath", true);
  xmlhttp.onreadystatechange = function () {
     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 
        alert(xmlhttp.responseText);
        //this gives me a popup of the encoded data returned by the php script
        // the format i see in the popup window is ["1","2"]
        var temp=$.parseJSON(xmlhttp.responseText);
        alert(temp.count);
        //however this produces an undefined value
     }
  xmlhttp.send();
}
では、返された文字列を解析して正しいカウントを表示するにはどうすればよいですか (ここではカウントは 2 である必要があります)。