embedded form loads just before page finishes

JD_Nelson
Level 10 - Community Advisor

embedded form loads just before page finishes

I'm hoping there's a way to change the page load order to get my embedded forms to load faster - my designer says the page loads like 'reading a book' and that our form is loading in the oder it is on the page -- I'm hoping there's something I can pre-load somehow so it doesn't 'flash' onto the page -- it's very noticeable.

Tags (1)
2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: embedded form loads just before page finishes

Can you move this to Products​?

SanfordWhiteman
Level 10 - Community Moderator

Re: embedded form loads just before page finishes

Hey there JD,

By their (default) nature, embedded forms load asynchronously. And in the absence of other information about your corporate site, that's a sensible default. It makes sense that you wouldn't want the form to fetch and load in a blocking fashion: you might have 5-10 other remote widgets loading asynchronously (think Twitter feed, dynamic Ajax panes, et al.) each of which is deemed mission-critical, so you don't want to give any one preference.

But in practice, it can be cumbersome to have a single container on the page render asynchronously, suddenly bulging out with your form (and pushing other elements around) after the rest of the page is done.

The easiest way to patch over the effect of re-flowing the page is to preallocate space for the form. For example, if you put it in a wrapper container with a fixed height, nothing will move around when the form renders.

Another aspect of a cleaner experience is setting the form to visibility: hidden by default, then showing it whenReady. Note this is always recommended if you're loading a form in a lightbox, so the form already exists and just needs to be displayed.

But there's actually a way to load the form synchronously as well, if you're sure that's what you want. You can PM me if you want to see it -- it's not yet something I'm publishing.