delphimvcframework/samples/pushnotifications_server/bin/www/ajax.js

17 lines
361 B
JavaScript
Raw Normal View History

2016-11-07 14:32:57 +01:00
function AJAX() {
var me = this;
this.callback = null;
function listener() {
me.callback(this.status, this.response);
}
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", listener);
this.get = function(URL, callback) {
me.callback = callback;
oReq.open("GET", URL);
oReq.send();
}
}