JavaScript Tutorial/Window/onload
Use alert dialog in only event
<html>
<head>
<title>Onload Example</title>
<body onload="alert("Loaded")">
</body>
</html>
Window onload event
<html>
<head>
<title>Onload Example</title>
<script type="text/javascript">
window.onload = function () {
alert("Loaded");
};
</script>
<body>
</body>
</html>