前台用jq发起一个post请求,请求都正常执行,但是发现后台报错了,Request method 'GET' not supported,好像程序无缘无故的提前发起了一个get请求,不知道为什么
$.ajax({
type : "POST",
url : "http://"+window.location.host+"/mobile/order/buyerOrderItems.json",
data:{"orderId":orderId,"typeCode":0},
// data : "orderId=" + orderId+ "&typeCode=0",
beforeSend: function () {
spinner.spin(document.getElementById("spin"));
},
success : function(data) {
$.each(data.result, function(i, content) {
var li=""+content.title+"
"
+""+content.buyQuantity+"
"
+""+(content.factory==""?"":content.factory)+"
"
+""+content.price.toFixed(2)+"
";
$(".productList>li").last().before(li);
});
spinner.spin();
},
error:function(data){
spinner.spin();
}
});
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你看一下是不是发起post请求的按钮还绑定了别的事件
用e.stoppropagation(); 停止冒泡试一下