Skip links
(() => { let a = document.createElement('div'); a.classList.add('freeze-ui'), window.FreezeUI = (b = {}) => { let c = document.querySelector(b.selector) || document.body; a.setAttribute('data-text', b.text || 'Loading'), document.querySelector(b.selector) && (a.style.position = 'absolute'), c.appendChild(a) }, window.UnFreezeUI = () => { let b = document.querySelector('.freeze-ui'); b && (b.classList.add('is-unfreezing'), setTimeout(() => { b && (b.classList.remove('is-unfreezing'), b.parentElement.removeChild(b)) }, 250)) } })(); var guid = ''; function stefan_onSubmit(e) { let kw = document.getElementById("keywords").value; console.log(kw) document.getElementById('stefan').hidden = true; // document.getElementById('spinner1').hidden = false; FreezeUI({selector: '#cont12'}) fetch(`https://test.howitzer.co/api/api/LandingPage/GetPotentialAudienceSize?keywordsCSV=${kw}`) .then(x => x.json()) .then(resp => { const total = resp.result.totalResults; guid = resp.result.userGuid; document.getElementById('respText').innerText = `ASD ${total}` document.getElementById('stefan2').hidden = false; // document.getElementById('spinner1').hidden = true; UnFreezeUI(); }) .catch(() => { // document.getElementById('spinner1').hidden = true; UnFreezeUI(); }) } function stefan_onSubmit2(e) { const email = document.getElementById('email').value console.log(email) // document.getElementById('spinner1').hidden = false; FreezeUI({selector: '#cont12'}) fetch(`https://test.howitzer.co/api/api/LandingPage/SendAudienceResultsToEmail`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ "emailAddress": email, "userGuid": guid }) }) .then(x => x.json()) .then(x => { console.log(x) // document.getElementById('spinner1').hidden = true; UnFreezeUI(); }) .catch(() => { // document.getElementById('spinner1').hidden = true; UnFreezeUI(); }) }