onload demo
Use
beforeunload
event handler