onload Event for a Window !

You must Login before you can answer or comment on any questions.

Hi, Is it possible to have a onload listener function for a window ? I need to call some function on load , however normal syntaxes not working. what i have tried is ..

Win.onload=function(){alert("onload");}
&
Win.addEventListener("load",function(){alert("onload")});
Both dint worked. How to achieve this ?

2 Answers

Hello Ivan....

u can also write...

win.addEventListener("focus",function(e){
    alert("onload");
});

Your Answer

Think you can help? Login to answer this question!