Home > DeveloperSection > Forums > Display alert on window load in Javascript
Chris S
Chris S

Total Post:48

Points:336
Posted on    February-28-2011 2:22 AM

 JavaScript JavaScript 
Ratings:


 2 Reply(s)
 14847  View(s)
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.


Alex R
Alex R

Total Post:40

Points:280
Posted on    February-28-2011 2:28 AM

Hi Chris,

You can display alert box on window load event.

window.onload = function () {

       alert('Welcome!');

}


Amit Singh

Total Post:103

Points:721
Posted on    October-11-2011 9:11 PM

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>

Don't want to miss updates? Please click the below button!

Follow MindStick