1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<html>
<head>
</head>
<script type='text/javascript'>
listStart= new Array() ;
function addToStart(fnc){
listStart[listStart.length]=fnc;
}
function start(){
for (i=0;i<listStart.length;i++){
if(listStart[i] instanceof Function) {
listStart[i]();
}
else { eval (listStart[i]); }
}
}
function one(){alert('one');}
function two(arg1,arg2){alert(arg1+" "+arg2+" "+arg3);}
addToStart(one);
addToStart("two('un','deux', 'et trois')");
</script>
<body onload='start()'> // <= attention tu avais marqué onlaod et pas onload
// ou window.onload = start; mais le soucis n'est pas là
</body>
</html> |
Partager