I’m having trouble viewing my two embedded HTML on published page (working fine in editor and preview). One (most importantly) is my Thrivecart checkout block. The other is a countdown timer (less important). Here are a few details:
When I inspect I see the following error:
VM11155 thrivecart.js:1 [iFrameSizer][Host page: tc-bordeleau-1-7FADNN-iframe] [Tab Visable] IFrame(tc-bordeleau-1-7FADNN-iframe) not found
Hey @Broberto, my checkout embed stopped working and I’m not sure why. I thought it may have been because of the ID that had changed upon updating the product in thrivecart. I believe I’ve updated everything correctly in the steps and have published but it is only showing in the edit/preview mode and not the published page. Here’s a loom to show what I’ve done which should be the same as what you’ve noted above. Please let me know if you spot the issue!
It’s probably a problem of timing. The script expects that the element is already in the page but weweb’s html component adds the element dynamically. Sometimes the element is already there when the script loads and executes, sometimes it’s not.
This kind of thing can usually be solved in a nice and clean way by creating a custom component for weweb.
Alternatively you can try to use some code with a mutation observer.
A very basic code would be
Hi @dorilama and @Broberto,
Thank you so much for taking the time to try and help me with this. I was able to test out the second and third option with no luck.
When I pasted in the first option (custom code for the timing issue) into the custom code header of the page it gave a “validation error” and the published page didn’t show the thrivecart embed.
When I tried the third option, the published page didn’t show the thrivecart embed either.
The validation error is a weweb problem (as long as you wrapped the code inside <scritp></script>), the editor doesn’t like multiline scripts even if they are valid javascript. You can also use the code in a javascript action on page load workflow.
In both methods the class and data attributes of the target element need to be correct, this may be the reason why it doesn’t work.
I copy/pasted your embed in my project and it works fine even in the published website. I had to toggle off “refresh on resize” though, else it disappeared when the iframe was resized. See the result on my test project => Blank | Start from scratch
Hi @Alexis, I’m part of the Bordeleau Team and we turned off the toggle “refresh on resize” and unfortunately it isn’t showing on the published end for us. We did the embed HTML and added the custom javascript. Do you happen to know if there is something else we can do?
@Alexis I tried this embed with the updated product ID that we are using and it still isn’t showing up on the front end. I put this in and disabled the javascript: