Display alert on window load in Javascript

Total Post:48

Points:336
 18964  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. 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!');
    }

      Modified On Mar-29-2018 04:34:19 AM
  1. 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>

      Modified On Mar-29-2018 04:34:35 AM

Answer