您不能从js访问数组(php数组)try
<?php$array = array(1,2,3,4,5,6);echo json_enpre($array);?>
和js
$(document).ready( function() { $('#prev').click(function() { $.ajax({ type: 'POST', url: 'ajax.php', data: 'id=testdata', dataType: 'json', cache: false, success: function(result) { $('#content1').html(result[0]); }, }); });});


