- milkod2001Asked on February 26, 2016 at 05:31 AM
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):
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.
- JotForm UI DevelopermertAnswered on February 26, 2016 at 08:58 AM
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.)
Please, try this method, it will optimize the page load times and also, don't forget to let us know the results.
- milkod2001Answered on February 26, 2016 at 09:20 AM
I have only used what was sitting within iframe, implemented it, updated files, tested it again and the results are actually the very same:
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?
- JotForm UI DevelopermertAnswered 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:
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:
- milkod2001Answered on February 26, 2016 at 11:18 AM
Thanks, i will give a stackoverflow solution a try
- JotForm UI DevelopermertAnswered on February 26, 2016 at 11:24 AM
You are kindly welcome. Please, don't forget to let us know about the results.
- milkod2001Answered on February 26, 2016 at 11:25 AM
- computeroverhaulsAnswered on February 28, 2017 at 02:23 PM
- JotForm SupportJohn_BensonAnswered on February 28, 2017 at 04:06 PM
In order for us to properly assist you, I have moved your question to a new thread. Please wait for our reply on this thread URL: https://www.jotform.com/answers/1078401