Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. lets say this is the json echo:
  2. {"count1":12,"cc":13,"count2":32, "cc2": 123, "totalcount":2}
  3. In totalcount it echo the total number of counts
  4. jQuery.ajax({
  5. type: "POST",
  6. dataType: "json",
  7. url: "file.php",
  8. data: { amount: $("#amount").val() },
  9. cache: false,
  10. success: function(response){
  11. var x = 0;
  12. while (x>response.totalcount){
  13. x=x+1;
  14. $("p").append(response.count[x]); // this is where I need your help
  15. }
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement