0

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>
techspl
  • 43
  • 5
  • Duplicate of: http://stackoverflow.com/questions/19761241/window-close-and-self-close-do-not-close-the-window-in-chrome – c0d3junk13 Aug 09 '14 at 16:13

1 Answers1

1
<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>
Donal
  • 31,121
  • 10
  • 63
  • 72