Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. $.ajax({
  2. /* type : "POST", */
  3. url : "launchapptest",
  4. /* contentType: "application/json; charset=utf-8", */
  5. data : "processDateInput="+processDate,
  6. dataType : "json",
  7. async: true,
  8. success : function(result) {
  9. var od = JSON.stringify(result) ;
  10. var obj = JSON.parse(od);
  11.  
  12. console.log(obj.od);
  13. console.log(obj.od.percentageCompleted);
  14.  
  15. console.log(od);
  16. $.each(JSON.parse(od), function(idx, obj) {
  17. console.log(obj.tagName);
  18. });
  19. }
  20. });
  21.  
  22. {
  23. "od": [
  24. {
  25. "dateProcessed": [
  26. "09/11/2014",
  27. "10/11/2014",
  28. "11/11/2014",
  29. "12/11/2014"
  30. ],
  31. "percentageCompleted": 25,
  32. "processRunning": 0,
  33. "remainingTime": 0,
  34. "successBatchCount": 0,
  35. "totalBatchCount": 0
  36. }
  37. ],
  38. "processDateInput": "12/11/2014"
  39. }
  40.  
  41. $.ajax({
  42. /* type : "POST", */
  43. url: "launchapptest",
  44. /* contentType: "application/json; charset=utf-8", */
  45. data: "processDateInput=" + processDate,
  46. dataType: "json",
  47. async: true,
  48. success: function (result) {
  49. var od = JSON.stringify(result);
  50. var obj = JSON.parse(od);
  51.  
  52. $.each(obj, function (index, value) {
  53. console.log(obj[index][0].percentageCompleted);
  54. console.log(obj[index][0].processRunning);
  55. console.log(obj[index][0].remainingTime);
  56. console.log(obj[index][0].successBatchCount);
  57. console.log(obj[index][0].totalBatchCount);
  58. console.log(obj.processDateInput);
  59. $.each(obj[index][0].dateProcessed, function (ind, val) {
  60. console.log(val);
  61. })
  62. });
  63.  
  64. }
  65. });
  66.  
  67. success: function(result) {
  68. console.log(result.od);
  69. console.log(result.od[0].percentageCompleted);
  70. }
  71.  
  72. {
  73. "od": [
  74. {
  75. "dateProcessed": [
  76. "09/11/2014",
  77. "09/12/2014"
  78. ],
  79. "percentageCompleted": 25,
  80. "processRunning": 0,
  81. "successBatchCount": 0,
  82. "totalBatchCount": 0
  83. }
  84. ],
  85. "processDateInput": "12/11/2014"
  86. }
  87.  
  88. var json = JSON.parse(result);
  89. var od = json['od'];
  90. var processDateInput = json['processDateInput'];
  91.  
  92. $.each(od, function(index, value){
  93. console.log(value, index);
  94. });
  95.  
  96. success: function(result) {
  97. console.log(result.od);
  98. console.log(result.od[0].percentageCompleted);
  99. console.log(od);
  100. $.each(result, function(idx, obj) {
  101. console.log(obj[0].dateProcessed);
  102. });
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement