I’m using postMessage to send iframe code from my dataset to an iframe on a dynamic page. Is there a way to have an alternate postMessage item that kicks in if the site is being viewed on mobile?
Current code:
let item = $w('#zipcodeset').getCurrentItem();
$w("#c1").onMessage((event) => {
$w("#c1").postMessage(item.chart1);
});
In my dataset, the content I need displayed normally is chart1 and the one that is sized for mobile is chart1Mobile. (the content doesn’t appear to be scalable for some reason, so this is my attempt at a work-around)
I’m still really new at this, and any help is greatly appreciated!