Skip to content

Instantly share code, notes, and snippets.

@stefcab
stefcab / AJAXTable.js
Created June 15, 2018 21:01 — forked from lukebiggerstaff/AJAXTable.js
A script to create a mobile first responsive table using AJAX and vanilla javascript
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;