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 6749179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:39:32+00:00 2026-05-26T12:39:32+00:00

As I talk about befor I’m using to jQuery to refresh / update a

  • 0

As I talk about befor I’m using to jQuery to refresh / update a webcam image.
This works just fine if you wanna update the image every 5th or 10sec.
But when your gonna do a stream with 10-15fps it gets into problems with most browsers
it seems. The problem seem to be that it sends a request befor the first one was done.
Is there a way to wait for the first request to be done befor sending a new update request for the webcam image? Because to me it seems to stack up requests if there is alittle delay on the server with the image.

Sorry if I did explain it alittle bad but… I’m norwegian and blode. Not the best combination. 🙂

Webcam Image is a single url
ex. http://www.ohoynothere.com/image.jpg

Old code I use.

     $(document).ready(function() {
        setInterval('updateCamera()',3000);
});

function updateCamera() {
    $('.online2').each(function() {
        var url = $(this).attr('src').split('&')[0];
        $(this).attr('src', url + '&rand=' + new Date().getTime());
    })
}
  • 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-05-26T12:39:33+00:00Added an answer on May 26, 2026 at 12:39 pm

    Definitely!

    It sounds like your best bet would be to use the jQuery.ajax() method ( http://api.jquery.com/jQuery.ajax/ ) or .get() method to chain your requests. Basically, you want a JavaScript function that does a request for the image using the .ajax() call. In the response handler, simply call the function again:

    function getMyImage() {
      jQuery.get(image_url, function(response) {
        jQuery('#img-name').attr('src', response);
        getMyImage();
      });
    }
    

    Whenever getMyImage successfully returns the image’s src value from the webcam, it will immediately go out and try to retrieve a new image, but not before the previous one is loaded.

    If I haven’t understood what you’re trying to do, please let me know. It would be helpful to know more about how the webcam image is retrieved (i.e. is it the same image src returned every time, etc.).

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

Sidebar

Related Questions

The Apple guidelines talk about using a source list - how do I create
Lots of people talk about writing tests for their code before they start writing
I was watching Anders' talk about C# 4.0 and sneak preview of C# 5.0
I feel like developers talk about memory leaks but when you ask them what
When we talk about security we have the following requirements: authentication integrity Non-repudiation Isn't
Most people talk about progressive enhancement right now as serving browsers with javascript (enhanced
I hear much talk about memcached , but when briefly studied on it, I
There exists a very good talk about C# vs. Java where H.Mössenböck compares the
I'm listening to a talk about C#4 's dynamic keyword and I'm wondering... Will
I need some resources that talk about how to design your software to be

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.