可能我正沉入一个空玻璃杯中,或者我在这个项目上花了太多时间,但它就是这样:我想从一个 htm 文件中使用 jquery 调用一个 php 脚本。
我的jQuery代码:
$.ajax({
type: "POST",
url: "localhost/calculate/vr4/getAmount.php",
data: "from="+ from_date +"&enddate=" + end_date,
success: function(info){
alert("test info : " + info);
}
});
php脚本:
$testdate=$_POST['from'];
if ($testdate==NULL)
{
echo "No text";
}
else
{
echo "a date";
}
什么也没发生,我在 url 中注意到了这一点:
http://localhost/calculate/vr4/summary_q.php?consult_range.x=30&consult_range.y=5
这些参数(consult_range)是我将click事件与jquery绑定的类名。任何指针?我已经尝试了这个论坛和其他人的几个代码示例,我得到了相同的结果。希望有人回答,我知道有点晚了