I have a dataset that holds a script to load a widget from CoinGecko. I have tried using postMessage to send the code text to the iFrame, but it is only showing a white box. Can somebody explain sending a message to the iFrame better? I have spent hours in the api documentation and I can’t wrap my head around how the example lines up with my code.
This is my Page Code. I know the code is getting the script and assigning it to the coinTickerSrc variable because I can use that to show the script in a normal text field.
$w.onReady( function () {
//To load the page before running the code
$w( “#dynamicDataset” ).onReady( function () {
//To load the dynamic dataset’s data before running the following code
let coinTickerSrc = $w( ‘#dynamicDataset’ ).getCurrentItem().coinTicker;
$w( '#coinTicker' ).postMessage(coinTickerSrc);
})
});