Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8478451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:45:00+00:00 2026-06-10T18:45:00+00:00

I am trying to load the latest image from a CCTV server for each

  • 0

I am trying to load the latest image from a CCTV server for each of our cameras on our network.

I have the following code, which works correctly and refreshes the image constantly. However, on the final version of the page there will be around 10 camera images on the page. I was wondering if the code I have now could be altered to refresh all images – not just specific ones.

At first I thought I could just use the same identifier for each image, but then I realised that the source of each image differs.

<html>
<head>
 <title>CCTV Test</title>
 <script type="text/javascript" language="JavaScript">
    newImage = new Image();

    function LoadNewImage()
    {
        var unique = new Date();
        document.images.ward.src = newImage.src;
        newImage.src = "http://192.168.1.64/image/WARD?time=" + unique.getTime();
    }

    function InitialImage()
    {
        var unique = new Date();
        newImage.onload = LoadNewImage;
        newImage.src = "http://192.168.1.64/image/WARD?time=" + unique.getTime();
        document.images.ward.onload="";
    }
 </script>
</head>
<body>
<img src="http://192.168.1.64/image/WARD" name="ward" onload="InitialImage()">
</body>
</html>

Any pointers would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:45:01+00:00Added an answer on June 10, 2026 at 6:45 pm

    Something along the lines of this:

    <!DOCTYPE html>
    <html>
    <head>
      <title>CCTV Test</title>
    </head>
    <body>
      <img src="http://192.168.1.64/image/WARD?time=...">
      <img src="http://192.168.1.64/image/WARD?time=...">
      etc.
      <script>
      setInterval(function() {
          var images = document.images;
          for (var i=0; i<images.length; i++) {
              images[i].src = images[i].src.replace(/\btime=[^&]*/, 'time=' + new Date().getTime());
          }
      }, 10000); // 10000 milliseconds = 10 seconds
      </script>
    </body>
    </html>
    

    This will refresh all images every 10 seconds.

    A different approach is to store the locations of the images in an array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i m trying load UIImages from server asynchronously in UITableViewCell. My code worked fine
Im trying to load a image at runtime in WPF using the following code
I have been trying to get the latest version of phpmailer from here: http://sourceforge.net/projects/phpmailer/files/
I'm trying to use SetLoadBalancerListenerSSLCertificate http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/APIReference/API_SetLoadBalancerListenerSSLCertificate.html from the Elastic Load Balancing api in my
I have a problem with out of memory when I'm trying load a few
trying to load in a bunch of images into a list from a directory...my
I trying to load and save setting with this code but when I closing
When trying to load Microsoft.Xna.Framework.dll from any project, it throws a FileNotFoundException. The specified
I'm trying to install the latest happstack-server on osx. They just added a dependency
I pulled the latest source from github. I'm trying to build: stephan@E6520:~/dev/ember.js$ rake rake

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.