thinkphp,ajax返回结果

thinkphp 在Action中

 

利用dump输出的是<pre>success</pre>

利用echo输出的是 success

1、html

eventResize: function(event,dayDelta,minuteDelta,revertFunc) {
//debugger;
//event Object {calendar_id: "7", user_id: "43", title: "特殊情况", start: Tue May 13 2014 00:00:00 GMT+0800 (中国标准时间), end: Wed May 14 2014 00:00:00 GMT+0800 (中国标准时间)…}

$.post("{:U('Calendar/edit','action=resize')}",{calendar_id:event.calendar_id,daydiff:dayDelta,minudiff:minuteDelta},function(msg){
if(msg!='success'){
alert(msg);
revertFunc();
}
});
}//

2、PHP

$m_alendar->update_time = time();
$res = $m_alendar -> save($data);
//dump($m_alendar->getLastSql());
if($res){
echo "success";

}

posted on 2014-05-06 12:28  yun007  阅读(1144)  评论(0编辑  收藏  举报