DISPLAY ALERT ON WINDOW LOAD IN JAVASCRIPT

Chris S

Total Post:48

Points:336
Posted by  Chris S
 17745  View(s)
Ratings:
Rate this:
Hi,

I want to display alert message on client side as soon as window loads.
Please help, its urgent.

Waiting for working solution.
  1. Alex R

    Post:40

    Points:280
    Re: Display alert on window load in Javascript

    Hi Chris,

    You can display alert box on window load event.

    window.onload = function () {

           alert('Welcome!');

    }

  1. Amit Singh

    Post:103

    Points:721
    Re: Display alert on window load in Javascript

    hi all,

    another way to call the function on body load,
    for example
    <html>
    <head>
    <script>
    function show()
        {
        alert("show alert");
        }
        </script>
    </head>
    <body onload="show()">
    </body>
    </html>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!