<script type="text/javascript">
function show(){
alert("sayHello");
}
window.οnlοad=show;页面载入时调用sayhello函数
window.οnunlοad=function(){
alert("sayBye");页面载入时调用sa函数
}
</script>
为window绑定onload事件。
为window绑定onunload事件。