Running Two Scripts


This page is an example of how you can run two scripts with the onLoad function at the same time. It is a seperate script that loads the two scripts. I know a lot of you asked for this, so here it is. Thanks again to Matthew Fortier for providing me with this script!

Now, the script that loads the other scripts goes in the <head></head> tag as well.

<script language="JavaScript">
function LoadFuncs() {
   FUNCTION #1
   FUNCTION #2
</script>
FUNCTION #1 is what is inside of the quotation marks in the <body onLoad="FUNCTION #1"> command. Same with FUNCTION #2.
In this example "FUNCTION #1" is "startclock()" and "FUNCTION #2" is "timerONE=window.setTimeout('scrollit(100)',500)"
You may also use more then two scripts, just add another function to this part of the script.

Now to start these scripts running, you need to put this line in your <body> tag.
onLoad="LoadFuncs()"
For example, mine looks like this

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#000080" ALINK="#000080" onLoad="LoadFuncs()">

I hope this helps!



Go Back to Doug's JavaScript Page