diff --git a/reports/local-costs/script.js b/reports/local-costs/script.js index 7c5d4d3..288c048 100644 --- a/reports/local-costs/script.js +++ b/reports/local-costs/script.js @@ -1,5 +1,7 @@ function getReportFromServer() { + var xhr = new XMLHttpRequest(); + xhr.onload = function() { if (xhr.status >= 200 && xhr.status < 400) { var repObj = JSON.parse(xhr.responseText), @@ -11,9 +13,12 @@ function getReportFromServer() { content += '' + repObj[repKeys[i]].payroll.total + ''; content += '' + repObj[repKeys[i]].expense.total + '' } - table.innerHTML = content; + var rh = xhr.getAllResponseHeaders(); } + table.innerHTML = content; } + xhr.open('GET', 'Report.json', true); xhr.send(); + }