Console is registering two error about iframe communication being blocked

  • ctphoto
    Asked on August 28, 2015 at 1:46 PM

    Looking at my webpage that has a jotform iFramed in it, I get these two errors. What do they mean?

     

    [Error] Blocked a frame with origin "https://secure.jotformpro.com" from accessing a frame with origin "https://stillrivereditions.com". Protocols, domains, and ports must match.

    (anonymous function) (jotform.forms.js, line 202)

    (anonymous function) (prototype.forms.js, line 54)

    responder (prototype.forms.js, line 549)

    dispatchEvent ([native code], line 0)

    fire (prototype.forms.js, line 574)

    _methodized (prototype.forms.js, line 60)

    fireContentLoadedEvent (prototype.forms.js, line 578)

    [Error] Blocked a frame with origin "https://secure.jotformpro.com" from accessing a frame with origin "https://stillrivereditions.com". Protocols, domains, and ports must match.

    (anonymous function) (jotform.forms.js, line 217)

    (anonymous function) (prototype.forms.js, line 54)

    responder (prototype.forms.js, line 549)

    dispatchEvent ([native code], line 0)

    fire (prototype.forms.js, line 574)

    _methodized (prototype.forms.js, line 60)

    fireContentLoadedEvent (prototype.forms.js, line 578)

  • Ben
    Replied on August 28, 2015 at 4:02 PM

    I can not see the same error in the console, but based on what you have posted it means that the code from the jotform - which is in the iframe, was sending the message to its script part (the one that you can find right after the iframe part):

    <script type="text/javascript">window.handleIFrameMessage = function(e) {var args = e.data.split(":");var 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 &gt; window.innerHeight) {iframe.style.height = window.innerHeight + "px";}break;case "reloadPage":window.location.reload();break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    Basically this code is checking the messages coming from the iframe to see if there is something that should be done to the iframe - like change its height - if new fields are shown, etc.

    Now, I do not see another iframe holding the jotform iframe, but I presume that there might be another code on your website capturing the iframe messages as well and sending this data to the iframe - causing the errors to be shown.

    These errors should not cause any issues, but if you want to resolve them, do let us know what is the browser that you got the error and if the error happens only on page load?

    Anything that you can tell us to be able to recreate the issue should allow us to better understand it and help resolve it.