这是代码,必须将dataType的格式改为html才能获取到数据,否则就会报错error 200。 $.ajax({
type:"POST",
async:false,
url:"<?php echo $this->generateURL('Film.Index', array('save'));?>",
data:dataparam,
dataType:"json",
success:function(msg){
巴扎黑2017-04-10 17:29:54
在服务端设置header头,header前不可有任何输出
header('Content-type: application/json');
服务端组装好的数据
echo json_encode($var);