Thank you! I have a dataset on my page. The field key for the HTML code in the database is htmlCode. The dataset is #dynamicDataset.
The page code is:
$w.onReady( function () {
let itemObj = $w(‘#dynamicDataset’).getCurrentItem().htmlCode;
$w(“#html2”).onMessage( (event, $w) => {
console.log(Message received by page code: ${event.data});
} );
setTimeout(() => $w(“#html2”).postMessage(“Message from page code!”), 2000)
;
}
);
The code inside the iFrame is:
<!doctype html>
Currently, the iFrame is a seethrough box. Am I missing the code to connect the iFrame body to the dataset? Is the page code correct now? Thank you for all your help!