Click here to Skip to main content
16,017,857 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to read the JsonData.json file below and populate my html table in javascript on the click of a button:
 [   {
        "ID": 1,
        "Name": "John Smith",
        "IDNumber": "7606015012088"
    },
    {
        "ID": 2,
        "Name": "Molly Malone",
        "IDNumber": "8606125033087"
    },
]

Please help as I am very new to javascript.
My html table has headers id, name, idnumber
Posted
Updated 10-Sep-16 0:02am
v3

This Link provides exactly what you needed
 
Share this answer
 
Hi,

Have you search for javascript/jQuery plugin ? check jQuery plugin to convert JSON data into Table.[^]

Best luck
-Amit
 
Share this answer
 
Try this
$.getJSON("JsonData.json", function(result){
$.each(result, function(i, field){
$("table").append("
"+field+"
");
});
});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900