【发布时间】:2011-07-05 08:56:02
【问题描述】:
谁能告诉我为什么以下页面在加载时没有触发警报?如果我使用 window.onload 而不是 document.onload 它可以工作。为什么会有这种差异?
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
document.onload = function() {
alert('Test');
}
</script>
</head>
<body>
</body>
</html>
【问题讨论】:
标签: javascript