刚刚开始使用thinkphp3.2,请教个ajaxReturn方式返回时,会多出一个html标签。。

浏览:1085 发布日期:2015/04/10 分类:求助交流
Controller对应action代码:

public function ajaxDemoAction(){
$cpuInfo = M('cpu_info')->getField('value',true);
$timeInfo = M('cpu_info')->getField('time', true);
$demo['cpu'] = $cpuInfo;
$demo['time'] = $timeInfo;
$this->ajaxReturn($demo,'JSON');
}

在前端页面调试时看到返回的reponse内容为:
<html>
{"cpu":xxxxx....}
在前面 多了一个<html>标签。。
另外直接echo $demo时也有这个标签。。
是否是使用方式不正确?多谢高手给些建议

附件 屏幕快照 2015-04-10 下午4.18.18.png ( 130.58 KB 下载:12 次 )

最佳答案
评论( 相关
后面还有条评论,点击查看>>