function fnGetDomain(url) { return url.match(/:\/\/(.[^/]+)/)[1]; } var hostDomain=window.location.host; var scriptIdTag=document.getElementById("dScript"); var scriptIdSrc=scriptIdTag.src; var scriptDomain=fnGetDomain(scriptIdSrc); // SD:egive-usa.com // Invalid Host