Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

How to embed an iFrame that contains JS

  • Hi everyone,

    I am redoing a site and it has a booking form that has an iFrame with Javascript.
    I’ve searched the forums here, but unsure of the best way to get it to work!
    The code I have received from the booking form people starts:
    <script type='text/javascript'>
    And ends
    </script>
    And the details they sent said: “Here is the iframe code to embed the eappointments booking into the website”

    I found one article here that says to create a shortcode, but not sure if that is the right way ?
    Any help appreciated.
    Dave
    ps – I can provide the full code if required ?

  • Hi there,

    have you tried adding the script inside a HTML Block ?

  • Thanks David,
    I just tried that, and I see the <script> in the source code, but nothing displays.
    Doesn’t it need to be in an iFrame somehow ?
    I see no errors in the console!
    Other thoughts ?
    Dave

  • What is the full code ? And can i see the site where the code has been added ?

  • Thanks David, info in the Private info

  • In the script there is the po.src which contains a URL to the d4w/resources/js/iframe.min.js and that URL is throwing a 403 Forbidden error. The code provider would need to help resolve that.

  • Thanks David,
    Sorry I had the wrong code in there – I found the code from the old site and tried that and forgot to put it back.
    The only difference is the number on the end of that po.src line.
    I tried again, but still no luck – I don’t see any 403’s, but I’m not sure 100% where to look.
    But I’ll run it past the supplier of the booking program as well.
    Dave

  • Hi there,

    When you run the URL in the browser, it indeed returns a 403 error. It should return some JS code if the URL is correct.

    You will definitely need to reach out to the booking app’s support team.

    Let us know how it goes.

  • Ok thanks very much, I’ll wait for their reply! I’ve sent a support request!
    Dave

  • No problem!

  • Closing this one off – the developer of the booking program got back to me with revised code.
    It just required me to add a script to an element and then the page just needed some custom HTML that was just a div with an ID to point it to the script and it all seems to be working OK.
    Thanks, Dave

  • Glad you managed to resolve it!

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.