【发布时间】:2013-11-15 07:47:29
【问题描述】:
尝试进行 ajax 调用并在 phpfox 中获得响应。
JS:
$.ajaxCall('module.check_whether_first_time',
'u_id='+u_id+'&my_user_id='+my_user_id).done(function(data) {
alert(" data = " + data )
});
ajax 从 ajax.class.php 中调用的函数:
public function check_whether_first_time(){
$u_id = $this->get('u_id');
$my_user_id=$this->get('my_user_id');
// processing with data goes here
$counter=1;
echo $counter;
}// end of function check_whether_first_time
我想在data 变量中获取$counter 的值。该代码不起作用,但 FireBug 显示 ajax 请求,但没有返回结果作为响应。有什么办法?
【问题讨论】:
-
试试:$this->call('alert("something");');只是为了检查您的代码是否到达该行。确保您的网站也显示错误