JavaScript Tutorial/Window/onload

Материал из Web эксперт
Перейти к: навигация, поиск

Use alert dialog in only event

   <source lang="javascript">

<html>

   <head>
       <title>Onload Example</title>
       <body onload="alert("Loaded")">
       </body>

</html></source>


Window onload event

   <source lang="javascript">

<html>

   <head>
       <title>Onload Example</title>
       <script type="text/javascript">
           window.onload = function () {
               alert("Loaded");
           };
       </script>
       <body>
       </body>

</html></source>