js:关于window.onload
下图来自: http://www.cnblogs.com/wsun/p/3916487.html 。 示例1 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <h1> heading 1</h1> <h1> heading 2</h1> <h1> heading 3</h1> <script> window.onload = function() { alert("text1");}; </script> <script> window.onload = function() { alert("text2");}; </script> </body> </html> 或者: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <h1> heading 1</h1> <h1> heading 2</h1> <h1> heading 3</h1> <script> window.onload = function() { alert("text1");}; window.onload =