Hi @gr8hoops21,
What are the 2 scripts you are using?
Hi @Hristian,
I think I am doing it backwards right now but here is the code:
Landing Page JS:
<script>
// This will need to be specific to the URL for your popup
const popupOrigin = "http://ce151c01c4a64ba9b3b84af944e85d0a.pages.ubembed.com/";
// On receiving message from the Convertable set a cookie
window.onload = function () {
function handleMessage (e) {
var eventData = JSON.stringify(e.data);
if (e.origin.includes(popupOrigin)) {
// Check for the message
if (eventData === 'variable') {
// do whatever you need with the variable
console.log('Test');
}
}
}
// Listen for the message from the popup
window.addEventListener('message', handleMessage);
}
</script>
iFrame Popup JS:
<script>
const buttonId = "#lp-pom-button-51";
const hostDomain = "*";
document.querySelector(buttonId).onclick = function () {
window.top.postMessage(JSON.stringify("variable"), hostDomain);
};
</script>
I have a button on the iFrame popup with that ID.
Could it potentially have any thing to do with the popup not showing up until 3 seconds after the page loads?