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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:59:53+00:00 2026-05-19T14:59:53+00:00

Hy, I have a 10 sec. delay page. var t = window.setTimeout(‘redirect(strUrl)’, 11000); And

  • 0

Hy,

I have a 10 sec. delay page.

var t = window.setTimeout('redirect(strUrl)', 11000);

And function redirect(strUrl) just does document.location

What would be nice if i have a little message displaying at the bottom of my page, for example: Redirecting in 10 seconds…

“one second later that setTimeout fired”

…Redirecting to destiny in 9 seconds..

etc

ps. and the dots at the end going from left to right you know it. .. …

I myselft would probably find out how to get that every second of timeout and just with jquery altered the number …if that would be possible at all.

  • 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-19T14:59:54+00:00Added an answer on May 19, 2026 at 2:59 pm
    var timeout = 11; // in seconds
    
    var msgContainer = $('<div />').appendTo('body'),
        msg = $('<span />').appendTo(msgContainer),
        dots = $('<span />').appendTo(msgContainer); 
    
    var timeoutInterval = setInterval(function() {
    
       timeout--;
    
       msg.html('Redirecting in ' + timeout + ' seconds');
    
       if (timeout == 0) {
          clearInterval(timeoutInterval);
          redirect(strUrl);
       } 
    
    }, 1000);
    
    setInterval(function() {
    
      if (dots.html().length == 3) {
          dots.html('');
      }
    
      dots.html(function(i, oldHtml) { return oldHtml += '.' });
    }, 500);
    

    See it on jsFiddle.

    If you wanted to have the second(s) thing, replace the appropriate line above with…

    msg.html('Redirecting in ' + timeout + ' second' + ((timeout != 1) ? 's' : ''));
    

    Of course, this works well with English, but probably isn’t as easy with other languages.

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

Sidebar

Related Questions

Hey programmers, I have removed everything from my function below to just target exactly
Quick question regarding settimeout, does it execute periodically like setinterval? Say I have a
Here is my Code: var sec = 10; var timer = setInterval(function() { $('#timer
I have the following function: function go_to(sec,name) { $(#lib_nav td:nth-child(2)).append('<span> &gt; <a style=cursor:pointer OnClick=$(\'.content\')
I have a section: \section{Introduction} \label{sec:introduction} I'd like a link to the section where
We have a query that is taking around 5 sec on our production system,
I have implemented a file transfer rate calculator to display kB/sec for an upload
Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have a piece of software that records a 5 sec interval of sound

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.