W3School TIY
编辑您的代码:
<html> <head> <script type="text/javascript"> function message() { alert("该提示框是通过 onload 事件调用的。") } </script> </head> <body onload="message()"> </body> </html>
查看结果: