delphimvcframework/samples/pushnotifications_server/bin/www/ajax.js
Daniele Teti 14c4489f41 New Demos
2016-11-07 14:33:05 +01:00

17 lines
361 B
JavaScript

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();
}
}