What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How Can I Increase the Performance of My Form on Wordpress?

    Asked by milkod2001 on February 26, 2016 at 05:31 AM

    HI guys,

     

    First of all, your jot forms are really amazing-piece of art.

    Im trying to implement one the my forms i have created on WordPress and i want to find out what are the best practices to do so.

     

    Form is working BUT(im getting this dform GT metrix):

    462.1KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.

    https://cdn.jotfor.ms/static/jotform.forms.js?3.3.11553 (238.9KiB) https://cdn.jotfor.ms/static/prototype.forms.js (115.0KiB)

    etc etc

     

    I have link on home page for my form, form is only visible when clicked on it BUT all javascripts are loaded when home

    page is loading and that unnecessary slows down website. 

     

    Form is implemented with iframe. That was only way how it worked.

     

    My question is: IS there any way i can setup iframe to load only when is needed(when someone will click on link for form)?

     

    Or is there any way how can i minimize the size of scripts which are coming with form.  My form has only 2 fields to fill and submit part . Over 353kb feels like awful load for that little im getting.

     

    Please help me with this.

     

    Thanks

     

    Page URL:
    http://www.michaelmurphy.ie/

    JotForm My Forms size cdn
  • Profile Image
    JotForm Support

    Answered by mert on February 26, 2016 at 08:58 AM

    Hi there,

    If you embed the the whole iFrame embed code currently, we shorten its length and size by deleting the unnecessary script part. As it is seen from the below, you don't need to take the whole structure of the embed code, the content between <iframe>...</iframe> tags is enough to embed your form. (Following code is just an example, please don't embed that one.)

     

        <iframe

          id="JotFormIFrame"

          onload="window.parent.scrollTo(0,0)"

          allowtransparency="true"

          src="https://form.jotform.com/53341292355958"

          frameborder="0"

          style="width:100%;

          height:800px;

          border:none;"

          scrolling="no">

        </iframe>

     

    Please, try this method, it will optimize the page load times and also, don't forget to let us know the results.

    Thanks.

  • Profile Image

    Answered by milkod2001 on February 26, 2016 at 09:20 AM

    Hi Mert,

     

    I have only used what was sitting within iframe, implemented it, updated files, tested it again and the results are actually the very same: 

    461.0KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.

    https://cdn.jotfor.ms/static/jotform.forms.js?3.3.11559 (238.9KiB) https://cdn.jotfor.ms/static/prototype.forms.js (115.0KiB) etc etc.

    I could live with 350kib of java scripts but i would like those scripts to load on website only if form is called for.

    Currently it is only a link, it only display pop up window with form when clicked on this link. But it loads when page is loaded which unnecessary slow down website. Is there any way in iframe to tell it to load script only when needed/clicked on link?

     

    Thanks

     

     

     

  • Profile Image
    JotForm Support

    Answered by mert on February 26, 2016 at 10:14 AM

    According to my last searches, you can put your iFrame into a button and it start to work only on button click. Please, check the related page from the link below:

    http://stackoverflow.com/questions/26285955/how-to-display-an-iframe-on-button-click

     

    In addition to this, you can try to embed your form by using the default script embed code as it is mentioned on the guide about how to embed your code to Wordpress:

     

    For .Org,

    http://www.jotform.com/help/4-Adding-Forms-to-Wordpress-org-version

     

    For.Com,

    http://www.jotform.com/help/299-How-to-Embed-Form-to-Wordpress-com

  • Profile Image

    Answered by milkod2001 on February 26, 2016 at 11:18 AM

    Thanks, i will give a stackoverflow solution a try

  • Profile Image
    JotForm Support

    Answered by mert on February 26, 2016 at 11:24 AM

    You are kindly welcome. Please, don't forget to let us know about the results.

     

    Regards.

  • Profile Image

    Answered by milkod2001 on February 26, 2016 at 11:25 AM

    Will do