Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Frank Goossens

    (@futtta)

    you could wrap that entire block in noptimize-tags (see FAQ) or add intercom_map_iframe to the comma-separated JS optimization exclusion list?

    frank

    Thread Starter Spectoos

    (@spectoos)

    Thanks Frank,
    I’ve added intercom_map_iframe, to the comma-separated list but it still doesn’t work …

    Cheers,
    Guy.

    Plugin Author Frank Goossens

    (@futtta)

    well, then you could go for the noptimize-approach? 🙂

    Thread Starter Spectoos

    (@spectoos)

    OK, <!– noptimize –> solved it!

    Cheers,
    Guy.

    Plugin Author Frank Goossens

    (@futtta)

    I see

    11:57:30.484 SyntaxError: unterminated string literal map:65:105

    on my browser’s console, so that confirms the JS has been excluded from optimization, but there seems to be a problem with it?

    Plugin Author Frank Goossens

    (@futtta)

    ah … just a sec, think I know what is happening …

    Plugin Author Frank Goossens

    (@futtta)

    ok, so AO injects the js before the </body>-tag. your JS has that tag in it, so AO injects the JS inside your code.

    so, try changing it into:

    <iframe id="intercom_map_iframe" src="" frameborder="0" height="600" width="800"></iframe><script>(function(){var d = document.getElementById('intercom_map_iframe').contentWindow.document;
    d.open().write('<body onload="document.location.replace(\'https://share.intercom.io/mnXeOFKMi-lg?embed=true\')"></bo'+'dy>');d.close();})();</script>

    so </body>'); becoming </bo'+'dy>');

    frank

    Plugin Author Frank Goossens

    (@futtta)

    ah, didn’t see you earlier message, noptimize FTW! 🙂

    Thread Starter Spectoos

    (@spectoos)

    🙂
    Thanks Frank for your help!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Non working embed code’ is closed to new replies.