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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:29:08+00:00 2026-06-04T20:29:08+00:00

I am trying to open multiple url in javascript for certain seconds and auto

  • 0

I am trying to open multiple url in javascript for certain seconds and auto close them. I have no background knowledge in programming, just a little php. I am doing it to demonstrate a project.

I have an array with some url’s.

var allURL = ["http://google.com", "http://yahoo.com", "http://msn.com"];

Now I want to open all url in new window/tab one by one for 10 seconds and auto close. So http://google.com opens for 10 seconds and auto close, then http://yahoo.com opens. Similar with all url’s in array.

can you kindly guide me how can this be achieved using setInterval or any other ways.

  • 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-04T20:29:09+00:00Added an answer on June 4, 2026 at 8:29 pm
    var allURL = ["http://google.com","http://yahoo.com","http://msn.com"];
    
    function showUrl(index) {
        index = index || 0;
    
        // are there any urls to show?
        // is the given index valid?
        if (allURL.length === 0 || index < 0 || index >= allURL.length) {
            return;
        }
    
        // open the url
        var popup = window.open(allURL[index]);
    
        // set a timer which closes the popup after 10 seconds and opens the next url by calling 'showUrl' with the next index
        setTimeout(function() {
            popup.close();
            showUrl(index + 1);
        }, 10000);
    }
    
    // To start the "diashow" call 'showUrl' without an index or if you want to start at a pre-defined url with the corresponding index
    showUrl();    // starts with the first url
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to open multiple URL's input streams, here's my current code FileInputStream fi
A little new to JQuery, I'm trying to have multiple links that open different
I have an odd issue happening when trying to open multiple Input Streams (in
I'm trying to open multiple pages following a certain format using mechanize. I want
I am trying open a new window using url.Action. And the new Window url
I am trying to open an URL with androids MediaPlayer Class by using: MediaPlayer.create(pContext,
I'm trying to open a prezi.com presentation from my app. NSURL *url = [
I'm new to C# and I'm trying to open multiple images to an array
I have long programming background, but am new to Python, and am playing around
I'm trying to open multiple files at once with the OpenFileDialog , using FileNames

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.