JSFiddle - React, Tailwind, and code Playground
HTML
<div id='foo'>Text</div>
JavaScript
XMLHttpRequest.prototype.open = (function(open) {
return function(method,url,async) {
document.getElementById('foo').innerHTML = 'outgoing url: ' + url;
console.log('the outgoing url is',url);
open.apply(this,arguments);
};
})(XMLHttpRequest.prototype.open);
function loadXMLDoc() {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
}
else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
//document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET",'/echo/json',true);
xmlhttp.send();
}
loadXMLDoc();