I have a problem I just can´t solve. When the dataset is ready I want to send a message that contain a link from a “text” to an “html component” but there is a typo error occur inside onReady function
This is the page code :
$w.onReady(function () {
//TODO: write your page related code here...
});
export function dynamicDataset_ready(event, $w) {
console.log("dynamicDataset_ready");
var link=$w("#text21").text;
console.log(link);
$w("#html2").postMessage(link);
console.log("dynamicDataset_ready:End");
}
And this is the error:
the event that I use:

anyone got any idea?
Hi! Try this:
export function dynamicDataset_ready() {
console.log(“dynamicDataset_ready”);
var link = $w(“#text13”).text;
console.log(link);
I mean eliminate of (event, $w) in brackets
But this looks like bug, i’m passing it to relevant team
Hi!
Thank you Mikhail
the problem when I edit the function occur now in the HTML Component’s HTML Code
the code enter this part "window . onmessage = (event) => { } " only one time just when the page loaded for the first time
window . onmessage = (event) => { }
I need to enter this part every time the dataset bring new information
<iframe id="imageid" src="https://graduway.com/wp-content/plugins/simplemap/inc/images/loading.gif" width="400" height="300" frameborder="0" scrolling="no" style="border:0 " allowfullscreen></iframe>
<div id="sidebar" style="height: 500px; width: 250px; float: right;">aa</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
document.getElementById("sidebar").innerHTML ="hi" ;
window.onmessage = (event) => {
document.getElementById("sidebar").innerHTML ="test" ;
if (event.data) {
document.getElementById("sidebar").innerHTML =event.data ;
document.getElementById("imageid").src=event.data;
}
document.getElementById("sidebar").innerHTML="end";
};
</script>
This works exactly how it was designed)
dynamicDataset_ready( ) - this function executes each time when dataset gets item from collection and get rady for any new action. In case of dynpage it’s usually only one item (if keyfield is unique) and thus this event happens only one time per one show of dyn page.
When do you want this to happen?