daverunt
03-17-2014, 05:02 PM
Hi,
First post here as my javascript knowledge is abysmal. Hoping you can help.
I have the code below to open a web page in the array every 60 seconds.
However what I would like it to actually do is open each page for 60 seconds then close it.
var myPages=["http://www.google.com", "http://www.yahoo.co.uk", "http://www.bing.co.uk"],
i = -1;
(function f(){
i = (i + 1) % myPages.length;
wo=window.open(myPages[i]);
setTimeout(f, 60000);
})();
First post here as my javascript knowledge is abysmal. Hoping you can help.
I have the code below to open a web page in the array every 60 seconds.
However what I would like it to actually do is open each page for 60 seconds then close it.
var myPages=["http://www.google.com", "http://www.yahoo.co.uk", "http://www.bing.co.uk"],
i = -1;
(function f(){
i = (i + 1) % myPages.length;
wo=window.open(myPages[i]);
setTimeout(f, 60000);
})();