Jump to content

Auto-refresh using HTML widget


HewsonJ

Recommended Posts

We've embedded a website using HTML (because the page we've embedded was so small using the built in widget was a literal waste of space) but I am wondering if you can execute JavaScript within the HTML widget?

<script>
 window.setInterval("reloadIFrame();", 3000);

 function reloadIFrame() {
     document.frames["Name1"].location.reload();
 }
 </script>
<iframe src="URL" id="Name1" style=" height: 70px; border:0px; padding:0px; margin:0px;"></iframe>

Is it my code that's incorrect (should it be the name tag rather than id in the iframe for example) or is it just a limitation of the widget we're using? It's a status checker for another service we use that allows us to see if the service needs restarting at any of our schools.

Link to comment
Share on other sites

<script>
 function reloadIFrame() {
     document.Name1.location.reload();
 }
    
 window.setInterval(reloadIFrame, 3000);
 </script>
<iframe src="URL" name="Name1" style="height:70px;border:0px;padding:0px;margin:0px;"></iframe>

couple of slight changes, good to go (after you change URL to a real URL :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...