Refresh IFrame with WordPress 3.5

With the previous WordPress version, I used to use the following code to automatically refresh an iframe in a post:

<iframe id='feuille1' src="http://competition.hockeyfrance.com/la/ffhgsheet.php?GameID=20094" width="650" height="1000" name='feuille1' ></iframe> 
<script type="text/javascript"> function refreshiframe() { document.getElementById('feuille1').src="http://competition.hockeyfrance.com/la/ffhgsheet.php?GameID=20094" setTimeout("refreshiframe()",30000); } </script> 
<body onload="refreshiframe();">

The code is embedded in the post using a shortcode. This worked fine until the recent 3.5 update, which I understand includes an updated version of jQuery.

Read More

Can someone help me to understand why this very simple code does not work anymore? What can I do to fix it?

Related posts

Leave a Reply

1 comment

  1. Change this:

    <script type="text/javascript"> function refreshiframe() {document.getElementById('feuille1').src = "http://competition.hockeyfrance.com/la/ffhgsheet.php?GameID=20094"  setTimeout("refreshiframe()",30000); } </script>
    

    To:

    <script type="text/javascript"> function refreshiframe() {document.getElementById('feuille1').src = "http://competition.hockeyfrance.com/la/ffhgsheet.php?GameID=20094"; setTimeout("refreshiframe()",30000); } </script>
    

    Notice the ; dividing the two different js instruction, one for changing the src and the other calling the setTimeout function.

    Good luck!