JSFiddle - React, Tailwind, and code Playground
JavaScript
function HTMLinXHR() {
if (!window.XMLHttpRequest)
return false;
var req = new window.XMLHttpRequest();
req.open('GET', window.location.href, false);
try {
req.responseType = 'document';
} catch(e) {
return true;
}
return false;
}
var msg = HTMLinXHR() ? "Your browser supports HTML in XHR, yay! \\o/" : "Your browser does not support HTML in XHR, booo! :-(";
alert(msg);