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

  • Home
  • SEARCH
  • 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 9010725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:32:24+00:00 2026-06-16T02:32:24+00:00

Is anyone able to determine, how to stop the jQuery caching the image that

  • 0

Is anyone able to determine, how to stop the jQuery caching the image that it grabs, and displaying the same image around and around again?

Basically the image is been re-uploaded every 5 seconds, as it acts as a webcam (if you check the time stamp on the bottom right of the image, you can tell if it’s been updated or not)

http://colourednoise.co.uk/scripts/index.htm

Thank you

(sorry I forgot to hit paste for the code)

$(function(){
$(document).ready(function() {
    var imgs = ['http://www.ramseycommunityradio.co.uk/images/webcam.jpg', 'http://www.ramseycommunityradio.co.uk/images/webcam.jpg']
    $("#webcam").attr('src', imgs[1]);
    var refreshId = setInterval(function() {
        $("#webcam").fadeOut("slow", function() {
            var $el = $(this);
            $el.attr('src', $.inArray($el.attr('src'), imgs) === 0 ? imgs[1] : imgs[0]);
            $el.fadeIn("slow");
        });
    }, 2000);
});
  • 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-16T02:32:25+00:00Added an answer on June 16, 2026 at 2:32 am

    your code:

    var imgs = ['http://www.ramseycommunityradio.co.uk/images/webcam.jpg', 'http://www.ramseycommunityradio.co.uk/images/webcam.jpg']
        $("#webcam").attr('src', imgs[1]);
        var refreshId = setInterval(function() {
            $("#webcam").fadeOut("slow", function() {
                var $el = $(this);
                $el.attr('src', $.inArray($el.attr('src'), imgs) === 0 ? imgs[1] : imgs[0]); 
    // this condition is redundant, it will ultimately give the same result always
    // because imgs[0]==imgs[1]
    
                $el.fadeIn("slow");
            });
        }, 2000);
    

    as far a JQuery is concerned you are not changing the SRC attribute (JQuery knows nothing about the content of the image). Try using two different names in the server-side like webcam0.jpg and webcam1.jpg and alternating between them.

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

Sidebar

Related Questions

Has anyone been able to implement a scrollable table in HTML where the TOP
Has anyone been able to get Windows Installer to use the InstallUISequence table during
I'm wondering whether anyone has been able to use the Microsoft Chart control in
Is anyone able to provide a definitive guide to the labelled icons in Xcode
Is anyone able to use Scala IDE in Eclipse with syntax highlighting showing different
Would anyone be able to tell me how to pull the server name out
Would anyone be able to help me with how to get the file properties
Would anyone be able to tell me what I'm doing wrong in the following
So my quick question to everyone is, would anyone be able to explain to
Would anyone please be able to tell me the most efficient way to compare

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.