我实际上已经阅读了我的问题的所有相关答案,但我需要一个清晰简单的示例来说明如何正确实现下面的代码。
我的主页.php
jQuery
var url = "computeArea.php";
var data = $('thisForm').serialize();
$.post(url,data,function(response)); // how do i get the area being returned from
computeArea function? i need to save the
return value to a javascript variable
计算区域.php
function computeArea ($data){ // do i need to parse $data to make it an array?
return $area;
}
我是 jquery 的新手,您的帮助非常有帮助。谢谢你!