4 回答
TA贡献2036条经验 获得超8个赞
function go() {
var sel_1 = $('#select_1').val();
var sel_2 = $('#select_2').val();
$.post("compute.php", {
select_1 : sel_1,
select_2 : sel_2
}, function (answ) {
console.log(answ);
});
}
TA贡献1884条经验 获得超4个赞
尝试将您的 go 函数修改为如下所示:
function go() {
var sel_1 = document.getElementById('select_1').value;
var sel_2 = document.getElementById('select_2').value;
$.ajax({
method: "post",
url: "compute.php",
data: {"select_1":sel_1 , "select_2":sel_2},
success: function(data,status)
/* ------------ for debug I have an alert with a response ---- */
{
alert("passed data are: " + data + "\nStatus: " + status);
},
error: function(data,status)
{
alert("passed data are: " + data + "\nStatus: " + status);
}
});
}
TA贡献2016条经验 获得超9个赞
POST 被上面的 .htaccess 指令阻止。已更改,现在 POST 正在从 html 工作,但在使 js/ajax/jquery 工作以将我的数据发布到 compute.php 时仍然存在问题
添加回答
举报