JSFiddle - React, Tailwind, and code Playground
by Paul Davis
JavaScript
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status === 200) {
callback(null, xhr.response);
} else {
callback(status, xhr.response);
}
};
xhr.send();
};
getJSON('http://pos.ladyjanes.com/api/v1/salons?lat=42.612270&lng=-83.045040&dist=2500');