<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="js/test.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<button>按钮</button>
<button onclick="func1()">跳转到红页面</button>
<button onclick="func2()">关闭窗体</button>
<script type="text/javascript">
window.onload = function(){
alert("页面加载成功")
}
alert("你好")
</script>
</body>
</html>
原文:https://www.cnblogs.com/jeco-li/p/10171400.html