方法一:
[code]
<html>
<head>
<title>test onload</title>
<script>
function onloadTest() {
alert("hello onloadTest();");
}
</script>
</head>
<body οnlοad="onloadTest()">
</body>
</html>
[/code]
方法二:
[code]
<html>
<head>
<title>test onload</title>
<script>
function onloadTest() {
alert("hello onloadTest();");
}
</script>
</head>
<body></body>
<script>onloadTest();</script>
</html>
[/code]
[code]
<html>
<head>
<title>test onload</title>
<script>
function onloadTest() {
alert("hello onloadTest();");
}
</script>
</head>
<body οnlοad="onloadTest()">
</body>
</html>
[/code]
方法二:
[code]
<html>
<head>
<title>test onload</title>
<script>
function onloadTest() {
alert("hello onloadTest();");
}
</script>
</head>
<body></body>
<script>onloadTest();</script>
</html>
[/code]