求助:Request method 'GET' not supported


前台用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="<li><div class='productName' title='"+content.title+"'>"+content.title+"</div>"
                    +"<div class='productQuantity'>"+content.buyQuantity+"</div>"
                    +"<div class='productManufacturer'>"+(content.factory==""?"":content.factory)+"</div>"
                    +"<div class='productPrice'>"+content.price.toFixed(2)+"</div></li>";
                $(".productList>li").last().before(li);
            });
            spinner.spin();
        },
        error:function(data){
            spinner.spin();
        }
    });

post java Ajax

kinov 9 years, 2 months ago

你看一下是不是发起post请求的按钮还绑定了别的事件
用e.stoppropagation(); 停止冒泡试一下

你快间子间 answered 9 years, 2 months ago

Your Answer