You can use an HTML-component to realize your wished idea.
- Add an HTML-Component onto your page.
- Resize it like you want it to have on your site-page.
- Send your wished data to the HTML-Component with…
https://www.wix.com/velo/reference/$w/htmlcomponent/postmessage - And receive the data in the html-component to work with it…
Something like this…
Page-Code:
let divID = "myPlace"
$w("#myHtmlComponent").postMessage(divID);
HTML-Component-Code:
<!doctype html>
<html>
<head>
<script type="text/javascript">
function init () {
window.onmessage = (event) => {
if (event.data) {
myPlace = event.data
console.log(myPlace)
document.getElementById(myPlace).innerHTML = "Temperatue is ....";
}
else{}
}
}
</script>
</head>
<body onload="init();" style="background-color:lightgray;">
<div id=myPlace></div>
<h1>HTML Component Test</h1>
<p id="demo">Message will go here</p>
</body>
</html>