JSFiddle - React, Tailwind, and code Playground
HTML
Protocol: <span id="protocol"></span>
<br />
Server: <span id="server"></span>
<br />
Resource: <span id="resource"></span>
CSS
* {
font: 14px Courier;
}
JavaScript
var uri = document.URL;
if(uri.indexOf("jsfiddle") != -1) {
//found
alert("App is running on https://jsfiddle.net/ " + uri);
} else {
//nope
alert("Someone is running it at " + uri);
}
var winObj = [{
protocol: window.location.protocol,
server: window.location.host,
resource: window.location.pathname
}];
document.getElementById("protocol").innerHTML = (winObj[0].protocol);
document.getElementById("server").innerHTML = (winObj[0].server);
document.getElementById("resource").innerHTML = (winObj[0].resource);