with ajax json data : {"data":[{"product_price":"3000"}]}
how call data :3000 from data and product price
$.ajax({
type: "POST",
dataType: 'html',
url: '<?php echo base_url() . "index.php/product/getdataJson/" ?>' + product_id,
data: {
'product_id': product_id
},
success: function(data) {
var data_json = JSON.parse(data); // dont work
document.getElementById("demo").innerHTML = data_json.data ; // dont work
},
error: function() {
alert("did not work");
}
});
<p id="demo"></p>