Jump to content

Recommended Posts

Posted

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.

Posted

Yes, you can. The HTML widget literally inserts whatever you put in the widget onto the site it is on.

 

I will test you code and find out why it's not working

Posted
<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 :)

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...