Skip to content

Instantly share code, notes, and snippets.

View aaronbjork's full-sized avatar

Aaron Bjork aaronbjork

View GitHub Profile
function ajax(url, callback) {
var xhr;
xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.onreadystatechange = function () {
if (4 === xhr.readyState && 200 === xhr.status) {
callback(xhr);
}
};
xhr.send();