Preloading form scripts

  • Profile Image
    Max 
    Asked on October 22, 2021 at 10:41 AM

    Hello. Form Jotform works on our client's website.

    The problem is that google pagespeed is responsive to scripts of the Jotform form:

    /static/jotform.forms.js

    /static/prototype.forms.js

    Images in attachments.

    I tried to set the async and defer attributes. But it did not help.

    Please tell me how to postpone these scripts until the page is fully loaded.

    Thanks!

    Screenshot
  • Profile Image
    IvayloK
    Answered on October 22, 2021 at 11:05 AM

    What embed method do you use?

    I would suggest you to try iFrame. Since the form is displayed inside an iFrame, it might help. This guide will help you to obtain the iFrame code:

    https://www.jotform.com/help/148-getting-the-form-iframe-code

    Let us know, how it goes and if this helps.

  • Profile Image
    Max 
    Answered on October 22, 2021 at 12:04 PM

    Insert <script> is used. But how can you delay the loading of <iframe> tag?

  • Profile Image
    Max 
    Answered on October 22, 2021 at 12:06 PM

    Insert script is used. But how can you delay the loading of iframe tag?

  • Profile Image
    Basil_A
    Answered on October 22, 2021 at 12:49 PM

    Hi,

    It is not possible to make any changes to the script code, please attempt using the iframe code instead of the script.

    Iframes allow using the Lazy loading property, which should delay loading them.

    https://web.dev/iframe-lazy-loading/

    If the issue persists, please provide the link to your page.

    Please let us know if you require any further assistance.