The window object represents an open window in a browser.
If a document contain frames (<frame> or <iframe> tags), the browser creates one window object for the HTML document, and one additional window object for each frame.
alert("An error occurred!")
However, the window object is the highest level JavaScript object, therefore the following code does the same thing:
window.alert("An error occurred!")
事件Event
onunload
onload
onfocus
onblur