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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -