Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 396
rudolph9 Avatar asked Jan 27 '12 06:01

rudolph9


1 Answers

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> 
like image 166
mack Avatar answered Nov 03 '22 02:11

mack