$.ajax
<input class="du_click" type="button" value="按钮" />
<?php
$du = array('name'=>$_POST['du']);
echo json_encode($du);
?>
<script type="text/javascript">
$(function(){
$(".du_click").click(function(){
$.ajax({
type:"POST",
url:"http://localhost/muke/Index/user",
async:true,
data: {du:'付秋霞'},
dataType: "json",
success:function(date){
alert(date.name);
},
error:function(){
alert(2);
}
});
})
})
</script>