HTML+JavaScript to open web pages regularly

1. Description: Open the webpage regularly

2. Principle: Use the set time function setTimeout and the function open() to open the window

3. Code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Timed close</title>

    <!-- script -->
    <script>
        // Call the function when the window is loaded
        // setTimeout("Called function", delay time (milliseconds));
        // window.open(url) open the window
        window.onload = function(){
            setTimeout("window.open('index.html')",3*1000);
        }
    </script>
</head>

<body>
</body>
</html>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325632678&siteId=291194637