$.getJSON("suppliermanagement.ashx", { action: "gsupplierinvoice", SupllierID: Supplierid }, function (data) {
alert("purchaseinvoice called");
alert(JSON.stringify(data))
var JsonInvoice = JSON.stringify(data);
$.each(data, function (key, item) {
// var invdata = data[i];
$("#Gridinvoice").append('<tr><td class="auto-style36" style="border-style: solid; border-width: thin">' + item.InvoiceDate + '</td><td class="auto-style36" style="border-style: solid; border-width: thin">' + item.SuppliersInvoiceNumber + '</td><td class="auto-style36" style="border-style: solid; border-width: thin"></td><td class="auto-style36" style="border-style: solid; border-width: thin">' + item.Type + '<td></tr>')
});
});
Above is my function to get the data in json format but I am not able to append using for loop and foreach loop. It shows undefined. How to append data in the table using for loop?
Here Is the result of JSON.stringify(data)
{"Dpurchaseinvoice":[{"pInvoiceDate":"/Date(1405708200000)/","pSupplierInvoiceNumber":"G003","pType":1},{"pInvoiceDate":"/Date(1405708200000)/","pSupplierInvoiceNumber":"H008","pType":1}],"ErrorMessage":"","mID":0,"mJobID":null,"mSupplierID":null,"mInvoiceDate":"/Date(-62135596800000)/","mOurRef":0,"mSupplierInvoiceNumber":null,"mPurchaseOrderRef":null,"mType":0,"mPaid":null,"mReferencePurchaseInvoiceID":null,"supplier":null,"JobID":null,"ID":0,"SupplierID":null,"InvoiceDate":"/Date(-62135596800000)/","OurRef":0,"SuppliersInvoiceNumber":null,"PurchaseOrderRef":null,"Type":0,"Paid":null,"ReferencePurchaseInvoiceID":null,"ErrorSummary":null,"ErrorList":[]}
{}toolbar button—I've done it for you this time.datais not a json format