To get current floors list send this postMessage:
iframeRoomtodo.contentWindow.postMessage(JSON.stringify({action:"get_floorsList"}), "*");
After that planner will return "send_floorList" message:
<iframe
frameborder="0"
id="iframe"
src="https://example.com/planner/matconfig">
</iframe>
<script>
window.addEventListener("message", messageListener);
function messageListener(e) {
try {
const dataObj = JSON.parse(e.data);
if (dataObj.action === "send_floorsList") {
let floorsArray = data.floors;// Looks like: ['First floor', 'Second floor']
}
} catch (error) {
console.error("Error parse JSON string!");
}
}
</script>