JSFiddle - React, Tailwind, and code Playground
JavaScript
var xmlhttp = null;
if (window.XMLHttpRequest) { // code for Firefox, Opera, IE7, etc.
xmlhttp = new XMLHttpRequest();
} else if (window.ActiveXObject) { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp != null) {
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) { // 4 = "loaded"
if (xmlhttp.status == 200) { // 200 = "OK"
console.log('reponse is:', xmlhttp.responseText);
} else {
console.log('oops, an error occured, xhr is: ', xmlhttp);
}
}
}
xmlhttp.open("POST", '/echo/html/', true);
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlhttp.send("html=jó öreg ajax, de azért ezt kerüljük..:)");
} else {
alert("This is a not supported browser / Az ön böngészője nem támogatott! Please contact with the system administrator / Kérem konzultáljon a rendszergazdával!");
}