JotForm not showing on initial loading, but appears on refresh

  • csanders7070
    Asked on June 14, 2017 at 6:06 PM

    Hello,

     

    The site is https://www.callahan-enterprises.com/careers/. I've checked it on multiple browsers and the form initially does not appear, but whenever you refresh the page it then appears. I'm using Squarespace to create the site, and I followed the directions on your website for moving the form to Squarespace. Any ideas? Thanks,

     

    cas

  • Welvin Support Team Lead
    Replied on June 14, 2017 at 6:40 PM

    Please re-embedding the form with just the iframe part of the form embed codes, the following:

    <iframe id="JotFormIFrame-71624041744148" allowtransparency="true" src="https://form.jotform.us/71624041744148" frameborder="0" style="width:100%; height:1131px; border:none;" scrolling="no"> </iframe>

    You have to remove the following scripts:

    <script type="text/javascript"> var ifr = document.getElementById("JotFormIFrame-71624041744148"); if(window.location.href && window.location.href.indexOf("?") > -1) { var get = window.location.href.substr(window.location.href.indexOf("?") + 1); if(ifr && get.length > 0) { var src = ifr.src; src = src.indexOf("?") > -1 ? src + "&" + get : src + "?" + get; ifr.src = src; } } window.handleIFrameMessage = function(e) { var args = e.data.split(":"); if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[2]); } else { iframe = document.getElementById("JotFormIFrame"); } if (!iframe) return; switch (args[0]) { case "scrollIntoView": iframe.scrollIntoView(); break; case "setHeight": iframe.style.height = args[1] + "px"; break; case "collapseErrorPage": if (iframe.clientHeight > window.innerHeight) { iframe.style.height = window.innerHeight + "px"; } break; case "reloadPage": window.location.reload(); break; } var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false; if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) { var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)}; iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*"); } }; if (window.addEventListener) { window.addEventListener("message", handleIFrameMessage, false); } else if (window.attachEvent) { window.attachEvent("onmessage", handleIFrameMessage); } </script>

     

    This should work. If not, update us through this thread. 

  • csanders7070
    Replied on June 14, 2017 at 6:45 PM

    Thank you. It appears that this worked perfectly.