U
Une Bévue
i'd like to intercept the window.onload event in order to distribute it,
as needed, to several methods.
example :
suppose i have several methods doing unlinked initialisations:
method_1=function(e){<initializes variable 1>}
....
method_n=function(e){<initializes variable n>}
and i want a mean to execute all the methods 1 to n when the event
window.onload arroses as i would have an overall method "init_all" :
window.onload=init_all;
function init_all(e){
method_1(e);
...
method_n(e)
}
how could i "register" all those methods to the overall one ?
because i don't know, in advance, the methods 1 to n.
i'd like to have something like :
init_all.add(method_1);
....
init_all.add(method_n);
aside from that is the "dummy" arg"e" usefull ?
because i've seen, following a typo of me, forgetting this arg let the
function works as usual ???
as needed, to several methods.
example :
suppose i have several methods doing unlinked initialisations:
method_1=function(e){<initializes variable 1>}
....
method_n=function(e){<initializes variable n>}
and i want a mean to execute all the methods 1 to n when the event
window.onload arroses as i would have an overall method "init_all" :
window.onload=init_all;
function init_all(e){
method_1(e);
...
method_n(e)
}
how could i "register" all those methods to the overall one ?
because i don't know, in advance, the methods 1 to n.
i'd like to have something like :
init_all.add(method_1);
....
init_all.add(method_n);
aside from that is the "dummy" arg"e" usefull ?
because i've seen, following a typo of me, forgetting this arg let the
function works as usual ???