rudolph9 rudolph9 - 1 month ago 7
HTML Question

open page automatically using javascript

Essentially, all I want to do is open an external web page after the current page is loaded via java script.

open my page -> javascript tells browser to open external page -> external page being loaded into the broser


How may I accomplish this?

Answer

you may use this

<html>
    <head>
    <script type="text/javascript">
    function load()
    {
    window.location.href = "http://externalpage.com";

    }
    </script>
    </head>

    <body onload="load()">
    <h1>Hello World!</h1>
    </body>
    </html> 
Comments