In the previous post, we discussed the basics of js.

Window Object



The Window object is the top-level object in JavaScript and contains in itself several

       other objects, such as "document", "history" etc.

     Events

       Events handlers supported by a Window object may be:

 

Events

Description

onblur

Code is executed when the window loses focus.

onerror

Code is executed when a JavaScript error occurs.

onfocus

Code is executed when the focus is set on the current window.

onload

Code is executed when the page has finished loading.

onresize

Code is executed when the window is resized.

onunload

Code is executed when the page is unloaded (visitor leaves the page).

For example,

       <body onload="dothis()">
        window.onload=dothis //inside your script

 here onload is an event that called dothis function on load of complete page.

as we can run another event on our need.

Post a Comment

أحدث أقدم