Embedded form not showing since updates | Community
Skip to main content
Jonathan_Haines
New Participant
February 4, 2021
Solved

Embedded form not showing since updates

  • February 4, 2021
  • 2 replies
  • 3594 views

Has anyone had issues with embedded forms not showing?
- Our CNAME is set and the code has been updated appropriately.

- We have an SSL certificate set on our Marketo assets, so it shouldn't be a mixed content issue.
It shows on the backend of our website but not the front end. I have been going back and forth with Marketo support for almost two days with no progess, so looking to see if anyone else has experienced this and found a solution.

 

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Not much of a mystery here!  The cause is straightforward.

 

Checking your F12 Console, you'll see this error:

 

 

That's because you're trying to use the global MktoForms2 object before it exists. And the reason it doesn't exist is you've added the defer attribute to the script tag (it's not there by default):

 

 

<script src="//go.datadimensions.com/js/forms2/js/forms2.min.js" defer></script>

 

 

 

defer — by design — does not load the script immediately, instead deferring it to a background fetch.

 

This means in the very next inline <script>, when you try to run MktoForms2.loadForm, it fails. This is expected behavior.

 

While defer means loading an external JS file won't block rendering of your page, it also means you need your code to be aware that you're defer-ing.  You can't just add in that attribute without potentially upsetting things.

 

2 replies

SanfordWhiteman
New Participant
February 7, 2021

@jonathan_haines please come back and check your thread, thanks.

SanfordWhiteman
New Participant
February 4, 2021

You will have to provide a link for someone to see what you're seeing.

Jonathan_Haines
New Participant
February 8, 2021

The page it is supposed to be showing on is https://datadimensions.com/contact/.

 

The form that you do see is NOT a Marketo form because we have to have a functioning form available.

Jonathan Fox-Haines
SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
February 8, 2021

Not much of a mystery here!  The cause is straightforward.

 

Checking your F12 Console, you'll see this error:

 

 

That's because you're trying to use the global MktoForms2 object before it exists. And the reason it doesn't exist is you've added the defer attribute to the script tag (it's not there by default):

 

 

<script src="//go.datadimensions.com/js/forms2/js/forms2.min.js" defer></script>

 

 

 

defer — by design — does not load the script immediately, instead deferring it to a background fetch.

 

This means in the very next inline <script>, when you try to run MktoForms2.loadForm, it fails. This is expected behavior.

 

While defer means loading an external JS file won't block rendering of your page, it also means you need your code to be aware that you're defer-ing.  You can't just add in that attribute without potentially upsetting things.