Created
July 26, 2016 13:59
-
-
Save ErikBoesen/3fb8ac1781c139e8c4b5d750ea4d5c2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateTable() { | |
table.innerHTML = ''; | |
var data = fs.readFileSync(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'] + '/Desktop/data.json', 'utf8'); | |
data = data.split('}'); | |
for (var i in data) { | |
console.log(JSON.parse(data[i])); | |
} | |
//data = JSON.parse(data); | |
console.log(data); | |
for (i = 0; i < data.length; i++) { | |
var tr = document.createElement('tr'); | |
for (var k in data[i]) { | |
var td = document.createElement('td'); | |
td.innerHTML = data[i][k]; | |
tr.appendChild(td); | |
} | |
table.appendChild(tr); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment