Получить данные из массива php - AJAX -jQuery

У меня есть страница, как показано ниже;

<head>
<script type="text/javascript" src="jquery-1.6.1.js"></script>
<script type="text/javascript">
$(document).ready( function() {
$('#prev').click(function() {
  $.ajax({
  type: 'POST',
  url: 'ajax.php',
  data: 'id=testdata',
  cache: false,
  success: function(result) {
    $('#content1').html(result[0]);
  },
  });
});
});
</script>
</head>
<body>
<table>
<tr>
<td id="prev">prev</td>
<td id="content1">X</td>
<td id="next">next</td>
</tr>
</table>
</body>

и файл php ajax.php для обработки запросов ajax как;

<?php
$array = array(1,2,3,4,5,6);
echo $array;
?>

Но когда Нажимаю, я получаю A вместо массива [0]. Как я могу это исправить ??

Заранее спасибо ...

23
задан blasteralfred Ψ 18 June 2011 в 11:40
поделиться