View Full Version : Running Onload
hari.kara
08-27-03, 09:55 AM
Can anyone tell me if there is any way of running two or more onload commands at the same time on a single page. And if there is can you show me or direct me in the right direction.
:confused:
Originally posted by hari.kara
Can anyone tell me if there is any way of running two or more onload commands at the same time on a single page. And if there is can you show me or direct me in the right direction.
:confused:
<html>
<head>
<title>Test</title>
<script language="javascript">
function cmdLoad() {
firstStep();
secondStep();
}
function firstStep() {
}
function secondStep() {
}
</script>
</head>
<body onload="cmdLoad()">
</body>
</html>
hari.kara
08-29-03, 10:54 AM
Thanks Shane,
Im assuming if i keep adding the classes ie third, fourth, i can run a fair few onloads at the same time?
Yup, that's correct.
I always did it that way because it's a lot easier to look at, unlike the inline version. (i.e onload="firstStep(); secondStep();")
hari.kara
08-29-03, 11:13 AM
Is there a limit to how many.. or are the constraints just the loading time...
I don't think there are any limits. It will just affect your loading time.
See also, here:
http://www.codelifter.com/main/tips/tip_002.shtml
hari.kara
09-01-03, 04:34 AM
Thanks EtLux an d Shane.. Problem solved!
vBulletin® v3.6.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.