Javascript examples for DOM HTML Element:Image
Run URL one by one using loop
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//w w w . j a v a2s .c o m var my = ['http://google.com', 'http://www.yahoo.com', 'http://gmail.com']; function work() { if(my.length==0) return; var url = my.shift(); var openWindow = window.open(url); setTimeout(function () { openWindow.close(); work(); }, 3000); } work(); } </script> </head> <body> </body> </html>