如何從以下JSON獲取product_price
值?獲取json響應的值php ajax
success: function(response){
if (response.data.product_id == true) {
alert("Success");
alert(response.data.product_price.val());
{
"data": {
"product_id": true,
"product_price": "434",
"product_name": "yahoo",
"product_long_description": "asdfasdf",
"product_care": "yess",
"product_image": "\/easyinteriors\/public_html\/product_images\/144257317733697.jpg"
}
}
alert(response.data.product_price);
我得到空值
您需要提供您的整個JSON和整個AJAX功能 – CodeGodie
我怎麼能做到這一點可以請你elobrate它 – user4464505
你得到'響應值.data.product_price.value'? – jtheman