Skip to content

Instantly share code, notes, and snippets.

@stefcab
stefcab / AJAXTable.js
Created Jun 15, 2018 — forked from lukebiggerstaff/AJAXTable.js
A script to create a mobile first responsive table using AJAX and vanilla javascript
View AJAXTable.js
var getTableDataAJAX = function() {
var getTableData = new XMLHttpRequest();
getTableData.onreadystatechange = function() {
if(getTableData.readyState === 4) {
var tableInfo = JSON.parse(getTableData.responseText);
var tableHeading = tableInfo.tableHeading;
var tableCellsPets = tableInfo.tableCellsPets;
var tableCellsPeople = tableInfo.tableCellsPeople;