<html>
<head>
</head>
<script>
window.onload = test;
function test()
{
alert("ok");
}
</script>
<body>
</body>
</html>
刷新时就触发,缺点是第一次执行时也触发:P