you cannot access array (php array) from js try
<?php
$array = array(1,2,3,4,5,6);
echo implode('~',$array);
?>
and js
$(document).ready( function() {
$('#prev').click(function() {
$.ajax({
type: 'POST',
url: 'ajax.php',
data: 'id=testdata',
cache: false,
success: function(data) {
result=data.split('~');
$('#content1').html(result[0]);
},
});
});
});