blob: 72ef1f76abc89e9ce4551f79c5ad8b5e7c9d2126 [file] [log] [blame]
"use strict";
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest
// r.addEventListener("progress", updateProgress, false);
// http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml
// http://stackoverflow.com/questions/6112744/load-javascript-on-demand
var Ajax = {
getJSON : function (url, onload) {
var r = new XMLHttpRequest();
r.open('GET', url, true);
r.setRequestHeader("Accept", "application/json");
r.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
r.onreadystatechange = function () {
if (this.readyState == 4)
onload(JSON.parse(this.responseText));
};
r.send();
}
};