我有以下 json 对象:
$scope.sellAccessories=
[
{"id": "1","name": "aa", "quantity": "3","total_price": "100"}
,
{"id": "2","name": "bb", "quantity": "4","total_price": "200"}
,
{"id": "3","name": "cc", "quantity": "5","total_price": "300"}
];
我使用ajax发送对象如下:
var options={
type : "get",
url : "../php/sell.php",
data: {"function":"sellAccess","data":$scope.sellAccessories},
dataType: 'json',
async : false,
cache : false,
success : function(response,status){
alert("success")
},
error:function(request,response,error){
alert("error")
}
};
$.ajax(options);
我尝试使用$_GET['name']接收数据,但没有成功
我的PHP代码:
$item_name=json_decode($_GET['name']);
我也尝试过: $data=json_decode($_GET['data']);
但它们都不起作用!
提前致谢