PDA

View Full Version : Run two functions onLoad


NRastogi
09-25-2002, 04:29 PM
Hi guys,

how could I use two functions onLoad of body of HTML, I tried in past and I was getting some error or the other function was never getting executed.

These functions needs to be run once after another.

Thanks,
NRastogi

beetle
09-25-2002, 04:35 PM
<body onload="fn1();fn2();">

or

<script>
function fn1() {
// code here
fn2();
}

function fn2() {
// code here
}
</script>

<body onload="fn1();">

chrismiceli
09-25-2002, 11:35 PM
you could also do this
function hi() {
// code here
}
function hi0() {
// code here
}
<body onLoad="hi(), hi0()">