inserire gli script nei tag è comunque la soluzione peggiore, intrusiva; ti propongo al volo delle alternative, magari fatti una ricerca:
1) usa window.onload
Codice PHP:
function funcunodue {
alert("hello word");
}
//.....somefunctions
window.onload = function() {
funcunodue();
altrafunc();
}
2) più moderna e al passo con le evoluzioni del dom attachevent (per IE) + addeventlistener ( per i browser standard
):
Codice PHP:
function init () {
//fai questo e quello
}
if (window.addEventListener) {
window.addEventListener("load", init, false);
} else if (window.attachEvent) {
window.attachEvent("onload", init);
} else {
window.onload =init;
// a mio avviso puoi anche omettere questo ultimo else
}
3)usare un framework javascript e le sue utilità, un semplice esempio con prototype:
Codice PHP:
Event.observe(window, 'load', somefunctions);
Event.observe($('bottone'), 'click', myfunc);