Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Export's historical data as JSON
data = [];
headers = [];
table = $('#historical-data').find('table');
headers = table.find('th').map(function(index, item){
return $(item).text();
table.children('tbody').find('tr').each(function(index, item){
var row = $(item);
var obj = {};
row.find('td').each(function(cellIndex, cell){
obj[headers[cellIndex]] = $(cell).text();
data[index] = obj;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment