function TinyAjax(callback) { this._req = null; this._sc = function() { if (_req.readyState == 4 && _req.status == 200) { callback(_req.responseText); } }; this.ajaxRequest = function(meth, url, as) { _req = new XMLHttpRequest(); _req.onreadystatechange = this._sc; _req.open(meth, url, as); _req.send(); }; }