Load event

When a page completes loading, the "load" event fires on the window and the document body objects.

Similar to focus-related events, loading events do not propagate.

When a page is closed or navigated away from (for example by following a link), a "beforeunload" event fires. This event prevents the user from accidentally losing work by closing a document. This can be done by returning a string from the handler which will be used in a dialog that asks the user and ensures if they want to stay on the page or leave it.

Note
Elements such as images and script tags that load an external file also have a "load" event that indicates the files they reference were loaded.
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents