使用jquery AJAX向服务器发送数据,然后在服务器上打印数据,因此:
php代码:function someFunc ()
echo json_encode("some");
}
$.ajax({
// here code for send
success: function (htm) {
htm = JSON.parse(htm);
alert(htm);
}
});
这工作,但当我需要从服务器和停止php函数工作后获得答案,在js中我不获取数据,也就是说,这不工作
function someFunc ()
echo json_encode("some");
return false;
}
没有return false;
的作品。请告诉我为什么?
你应该直接退出()而不是返回false