jquery - How to print JSON data? -
json:
{"id":"14","amount":"6300","credit_limit":"2017-09-22"}
jquery code:
$("#message").html("dear client, bill no."+response.id+" amount (as per invoice) has been generated. due date payment (as per credit limit). thank doing business us. luck.");
it showing undefined can please me how print json data?
first add <div>
or other element container id message
, can move on jquery
code can parse json , access json key:
var response = '{"id":"14","amount":"6300","credit_limit":"2017-09-22"}'; response=json.parse(response); $("#message").html("dear client, bill no."+response.id+" amount (as per invoice) has been generated. due date payment (as per credit limit). thank doing business us. luck.");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id='message'></div>
Comments
Post a Comment