我使用此代码向另一个页面发送发布请求。后调用有效,但没有参数发送到该页面:
$.ajax({ type: "POST", url: "insertar.php", data:"tipo_tar:1&monto:" + "1000" +
"&n_m:" + "100" + "&refe:" + "100"
+"&usuario:" + "pcisneros01"
+ "&email:" + "esadeghi@gmail.com" ,
contentType:"application/x-www-form-urlencoded",
success: function(result)
{
alert(result);
if(result.indexOf("SMS")>=0){
$(".centro").hide();
$(".content-area").hide();
$("#bodythxRecarga").show();
}
}
});
我很困惑。我遵守所有规则,但在目标页面中我没有任何发布数据。
最佳答案
在 data:
上将 =
替换为 :
。
例子:
data:"tipo_tar=1&monto=" + "1000"
关于javascript - Ajax jquery Post 没有发送参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20900120/