JSFiddle - React, Tailwind, and code Playground
by NickJosevski
HTML
<div id='output'>...</div>
JavaScript
function OnComplete (id, xhr) {
if (xhr.status == 200) {
var response;
try {
response = eval("(" + xhr.responseText + ")");
} catch(err) {
response = { };
}
//this._options.onComplete(id, name, response);
} else {
//this._options.onComplete(id, name, { });
}
$('#output').html('done');
};
var xhr = new window.XMLHttpRequest();
xhr.status = 200;
xhr.responseText = 'bla';
OnComplete (0, xhr);