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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:50:16+00:00 2026-05-13T06:50:16+00:00

I have a page that needs to be refreshed every 60 seconds. On this

  • 0

I have a page that needs to be refreshed every 60 seconds. On this page I am using iBox to popup various items. My problem is that a meta refresh kills the popup which is not wanted. Please keep in mind I have zero to little experience with javascript so my solution may be fundamentally wrong.

The solution I came up with is to use javascript to do the refresh. When the page loads I will start the timer, when an ibox pops up I will clear the timer, when the ibox closes I will start the timer again.

I am setting this up by using a simple function.

function timedRefresh(timeoutPeriod){
    var resetId = 0;
    resetId=setTimeout("location.reload(true);",timeoutPeriod);
}

Then I call the function <body onload="timedRefresh(60000)">.

My problem is stemming from when I try to call clearTimeout(resetID). I am trying to call the method from the ibox script’s hide function, but it doesnt actually clear out the timer. I think it may be a scope issue and I may need to do some sort of Object.clearTimeout(Object.resetID) but that is just a guess.

  • 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-13T06:50:16+00:00Added an answer on May 13, 2026 at 6:50 am

    Do this:

    function timedRefresh(timeoutPeriod){
        window.resetId = 0; // make it clear it's global by prefixing "window."
        window.resetId=setTimeout("location.reload(true);",timeoutPeriod);
    }
    

    Then from the relevant ibox function use window.resetId.


    Seeing your comment I’ll add something.

    “window.” will work when scripting within a browser, should you use JS somewhere else it probably won’t work.

    As long as you’re on a webpage, however, window is the global object and the “window.” prefix is IMO a good way to make it clear that certain variables are global; if you use it consistently, all the variables that don’t have “window.” in front of them are always local.

    You should know, however, that it would also work if you simply used resetId without any prefix and without var because any variable that isn’t declared with var is automatically scoped to window.

    This short-ish guide will teach you most of what you need to know about variable visibility in Javascript, execution contexts and closures. It will send you on your way to become a deadly Javascript ninja.

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

Sidebar

Related Questions

No related questions found

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.