document.write("<br/>"+"welcome")
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> </head> <body> <script> document.write("Heather1"+"<br/>"); function callAlert(){ alert("welcome2"); } window.onload=function() { alert("欢迎来GIAO哥的小店") } window.onbeforeunload=function(event) { var e=event||window.event; e.returnValue="下次记得来哟" } </script> <button onclick="alert('welcome1')">点击1</button> <button onclick="callAlert()">点击2</button> </body> </html>