TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Phani Kumar
NA
162
25k
How to convert JSON response list to array in jquery
Sep 10 2018 7:01 AM
Hi,
To whom so ever it may concern,
I am using API to fetch the data into my form using jquery, I am getting response as list in below mentioned way
list
:
Array(1)
0
:
due
:
null
originalAmount
:
463872
outstandingAmount
:
463872
taxperiod
:
from
:
"
2017-01-01
"
to
:
"
2017-02-01
"
__proto__
:
Object
type
:
"
VAT Return Debit Charge
"
while I am trying to fetch this list in below mentioned way
success(function (data) {
debugger;
if (data != null) {
if (data.status == 'Ok') {
//var xmlDoc = $.parseXML(data.d);
//var xml = $(xmlDoc);
//var customers = xml.find("Table");
//var rows = '';
for (var i = 0; i < data.list.length > 0; i++) {
debugger;
$scope.due = data.list[i].due == null ? '' : data.list[i].due;
$scope.originalAmount = data.list[i].originalAmount == null ? 0.00 : data.list[i].originalAmount;
$scope.outstandingAmount = data.list[i].outstandingAmount == null ? 0.00 : data.list[i].outstandingAmount;
$scope.paidAmount = (Number(data.list[i].originalAmount) - Number(data.list[i].outstandingAmount)) == null ? 0.00 : Number(data.list[i].originalAmount) - Number(data.list[i].outstandingAmount);
$scope.formtype = data.list[i].type == null ? '' : data.list[i].type;
}
}
}
but unable to get inside the for loop
here it may increase the count. I want to bind this data to html table, can anyone explain me how to acheive this, by this my project got stuck up, basing on this I need to pass the data to next page. This has to be done in jquery only
Thanks for the help in advance
Reply
Answers (
3
)
Download selected file as preview option using Jquery
Jquery datepicker value disappear after a submit button post