const currentUrl = new URL(window.location.href); if(currentUrl.host == 'dev11.shop4d.com') { //we're on a repair order var roid = ""; var ronumber = ""; var cid = "28"; var usertype = "repairorder"; var html = "
"; } else { //we're on a website somewhere var usertype = 'websitechat'; var cid = "28"; var pathname = encodeURIComponent(currentUrl.pathname); var html = "
"; } document.body.insertAdjacentHTML('beforeend', html);