I have the following JSON
returned from a controller
Laravel
:
{
"id": 105,
"tratamento_id": "24",
"eim": null,
"oft": "12",
"codigo_produto": "CO009-1200-1200",
"descricao_produto": "COMPENSADO 9X1200X1200 ",
"tipo_mercadoria": "2",
"comprimento": "2",
"largura": "2",
"espessura": "2",
"quantidade": ".0000",
"m3_unitario": "2.0000",
"m3_total": "2.0000",
"estufa": "0",
"nfe": "2",
"kit": "1",
"kit_id": null
}
But in javascript
I can not get the value of id
, follow the code with the tests I did:
$.post(URL+'/json/remover_item_kit',{
_token: $('input[name=_token]').val(),
id: $("#id_item_kit_delete").val()
}).done(function(data){
console.log("1 :" + data.id);
console.log("2 :" + data[0].id);
console.log("3 :" + data["id"]);
console.log("4 :" + data[0]["id"]);
});
follow the results:
1 :undefined
2 :undefined
3 :undefined
4 :undefined
I needed to access the properties of the date but I did not succeed.