Update an iframe/widget dynamically

This is what you will need…
https://www.wix.com/velo/reference/$w/htmlcomponent/postmessage

Step-1: Get your wished data-value out of your DB.
Step-2: Send the wished data-value to the HTML-Component.
Step-3: The following HTML-CODE goes into —> HTML-Component.

<!doctype html >
< html >
< head >
< script type = “text/javascript” >
function init () {
// when a message is received from the page code
window . onmessage = ( event ) => {
if ( event . data ) {
console . log ( “HTML Code Element received a message!” );
insertMessage ( event . data );
}
}
}
// display received message
function insertMessage ( msg ) {
document . getElementById ( ‘demo’ ). innerHTML = msg ;
sendReturnMessage ( “Message from the HTML Component!” );
}
</ script >
</ head >
< body onload = “init();” style = “background-color:lightgray;” >
< h1 > HTML Component Test </ h1 >
< p id = “demo” > Message will go here


</ body >
</ html >