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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:25:05+00:00 2026-05-28T06:25:05+00:00

I know what the problem I am experiencing is, I am just having a

  • 0

I know what the problem I am experiencing is, I am just having a hard time finding a work around. I was wondering if anyone had experienced something like this, and what kinda of solution they implemented.

I have a list system with pending repairs, and I want repairs that are late to blink black and red. It’s possible that there are multiple repairs in this list that are late.

here is my function:

function setblink(id) {
   var elm = document.getElementById(id);
    if (elm.color == "red"){
        elm.color = "black";
    }
    else{
        elm.color = "red";
    }
    setTimeout(setblink(id),500);
}

I have an array of “id’s” for the items that need to be blinking called repsToBlink.

I get the set blink intervals running for each of these repairs by running the following code, which puts them in a recursive loop.

for(var x in repsToBlink){
setTimeout(setblink(repsToBlink[x]),500);
}

How can I get this code doing the same thing, without causing a stack overflow?

Thanks!

  • 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-28T06:25:06+00:00Added an answer on May 28, 2026 at 6:25 am

    You need to change your setTimeout from

    setTimeout(setblink(id),500);
    

    to:

    setTimeout(function() { setblink(id) },500);
    

    setTimeout() expects a function to be passed as parameter, whereas you are passing the result of the function.

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

Sidebar

Related Questions

I just started using IntelliJ-IDEA, and I don't know if the problem resides with
I know I've had this problem before so I'm really frustrated. I've got the
Anyone know how to solve this problem? 03-23 13:03:20.585: WARN/googleanalytics(3430): Problem with socket or
Most of you probably know the following problem: You edit an HTML, view the
I don't know the exact problem. I am using flex mx:tree component in flex
I realy dont know what the problem is with VS2010. I created a class,
How do I let Microsoft know about a problem I've found in one of
Sometimes I've made a namespace in C# (I don't know if the problem is
I know I've solved this problem before, but I can't remember or find the
Was just wondering how you all go about centering a subview in the viewcontrollers

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.