• How do I get the following scripts to work on the same page?
    They work together in IE but not in Firefox and Mozilla.
    <script language=”JavaScript” type=”text/javascript”>
    function imgRefresh () {
    if (document.images) {
    rfsh = new Date() ; rfsh = “?”+rfsh.getTime()
    document.images[“webcam_picture”].src = ‘https://www.aeroport.lu/webcam/webcam1.jpg?’+rfsh;
    }
    setTimeout(‘imgRefresh()’,60*1000);
    }
    </script>
    <left>
    <img src=”webcam1.jpg” width=”130″ name=”webcam_picture” alt=””><br>
    </center>
    <p align=”left”>
    <script language=”JavaScript” type=”text/javascript”>
    imgRefresh();
    </script>
    <script language=”JavaScript” type=”text/javascript”>
    function imgRefresh () {
    if (document.images) {
    rfsh = new Date() ; rfsh = “?”+rfsh.getTime()
    document.images[“webcam_picture”].src = ‘https://www.aeroport.lu/webcam/webcam2.jpg?’+rfsh;
    }
    setTimeout(‘imgRefresh()’,70*1000);
    }
    </script>
    <left>
    <img src=”webcam2.jpg” width=”130″ name=”webcam_picture” alt=””><br>
    </center>
    <p align=”left”>
    <script language=”JavaScript” type=”text/javascript”>
    imgRefresh();
    </script>
    So, as you can see I want to call up 2 webcams from the local airport on the same page.
    You can see that 1 is running @
    https://www.cyber6.org
    Thanks in advance.
    Neil

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try giving each picture a different “name” attribue. I’ve had something similar working with a script much like yours, and it wasn’t a big problem.
    You also have two functions on the page with the same name, which is possibly a problem. Try changing the function names to img1Refresh and img2Refresh, and the names to “webcam_picture1” and “webcam_picture2”. Also remember to change the document.images[“webcam_picture”] bit in each script by adding the appropriate number.

    Thread Starter cyber6

    (@cyber6)

    Mant thanks Ibessant-now working!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘calling javascript experts!’ is closed to new replies.