Reputation: 43
Am trying open new browser window after every 5 minutes,before that am closing if any browser window alredy opened..But window.close is not closing it seems..
<html>
<head>
<script>
function mytimeout() {
window.open("http://www.starsports.com/ssplus/cricket/index.html?v=1344487");
window.setInterval(myFunc, 310000);
}
function myFunc() {
window.close();
window.open("http://www.starsports.com/ssplus/cricket/index.html?v=1344487");
}
</script>
</head>
<body onload="mytimeout()">
</body>
</html>
Upvotes: 0
Views: 189
Reputation: 32713
<html>
<head>
<script>
var mywindow;
function mytimeout() {
mywindow = window.open("http://www.starsports.com/ssplus/cricket/index.html?v=1344487");
window.setInterval(myFunc, 310000);
}
function myFunc() {
mywindow.close();
mywindow = window.open("http://www.starsports.com/ssplus/cricket/index.html?v=1344487");
}
</script>
</head>
<body onload="mytimeout()">
</body>
</html>
Upvotes: 1