I already have the html as a string in my site code now I want to pass this string to my html component. So all I wasnt is the HTML component to display the string that I passed on.
let html = '<html><head><html><head>...'
$w("#html2").postMessage(html);
<script type="text/javascript">
window.onmessage = (event) => {
if (event.data) {
let receivedData = event.data;
}
};
//
</script>
I see that the variable html contains html code which is not supported by Corvid.
And this might cause an issue when sending a message. Try using a regular string instead.
You can see an example and more information here .
Sorry, it is meant to be a string, what I want to know is how to set the code for the html component so that it displays the html that it’s passed on.
let html = 'html code here'
$w("#html2").postMessage(html);
//Then when when the html component receives it it will display it