Refresh embedded webpage on enter viewport

Hi, what would the code be to refresh an embedded webpage when it enters the viewport?

Hi,

export function html1_viewportEnter(event) {
    $w("#html1").src =  "https://";
    setTimeout(() => {$w("#html1").src = "https://mysite.com";}, 10);
}

Thanks J.D.

Unfortunately the code doesn’t seem to work, the embedded page:

www.leojoseph. net/1920digitallogo/1920digitallogo.html

will load, but not refresh when it enters the viewport - this means that if someone scrolls to the embedded page after it has already loaded, it won’t refresh again:

https://leojoseph5.wixsite.com/my-site

@l3q Make sure to turn on the viewportEnter function on the element property panel.

@jonatandor35 from what I can see it should be turned on:

@l3q your line 2 is wrong.
it should be:

$w("#html1").src =  "https://";//do not connect to a real URL

meaning a string that doesn’t connect to the current site.
In other words, you should “empty” the src, wait 10 milliseconds and reconnect it to the desired url;

Hi @jonatandor35

Thanks again for the support, I have amended the second line of code again and its still not working somehow. Any ideas on where its going wrong?