使用jQuery post,您可以定义一个回调函数,该函数在返回数据时执行:
$.post('/callcenter/admin/postContacts', data, function(returnedData) { // do something here with the returnedData console.log(returnedData);});本
data应在形式:
{name: 'value', anotherName: 'another value'}相当于在PHP端上的帖子名称,可以通过纯PHP进行访问,如下所示:
echo $_POST['name'];# prints "value"echo $_POST['anotherName']; # print "another value"



