【发布时间】:2016-06-27 14:16:35
【问题描述】:
我有这个代码:
$.post( "/ankauf/", {
"kunden_id" : 1,
"products" : products,
"full_price" : parseInt($('#totalPrice').text()),
"_token" : $('meta[name="csrf-token"]').attr('content')
},
function( data ) {
toastr.success("Ankauf abgeschlossen", "OK!");
}
);
就像我在应用程序中经常做的那样,它会向我的服务器发送一个发布请求。
Chrome 会这样显示这个请求:
Request Method:POST
Status Code:200 OK
Remote Address:192.168.178.80:1414
响应如下所示:
Cache-Control:no-cache
Connection:close
Content-Type:application/json
Response content:
array(7) {
["product_id"]=>
string(1) "5"
["paidprice"]=>
string(2) "85"
["condition"]=>
string(8) "Sehr Gut"
["ovp1"]=>
string(1) "0"
["ovp2"]=>
string(1) "0"
["ovp3"]=>
string(1) "0"
["ovp4"]=>
string(1) "0"
}
{"full_price":"85","updated_at":"2016-06-27 14:01:55","created_at":"2016-06-27 14:01:55","id":73,"created_by_id":1,"customer_id":1}
所以服务器响应看起来像一个有效的 JSON 响应,并且 http-code 是 200 any Ideas 为什么成功处理程序不会触发?
【问题讨论】:
标签: javascript jquery json post