onLoad twice

I have 2 onLoads in the body, but only the first one will work.
How can I make both work?

here's what i got:<BODY BGCOLOR="#OOOOOO" TEXT="#ffffff" LINK="#00ff40" VLINK="#C0C0C0" onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll" onLoad="pagestart();"
onUnload="if(brOK){stopme('joshhead');">
Q98Asked:
Who is Participating?
 
oubelkasCommented:
Guys,

Why so difficult?

Q98 >

Just use both functions in the onLoad event handler :

<body ...onLoad="makesnake();pagestart();">

Joseph
0
 
chewymonCommented:
What about something like:

<script>
var makesnake
var pagestart

function doIt(){
makesnake+pagestart
}
</script>

<body onLoad="doIt()"
0
 
xabiCommented:
Why don't you do this:

<script language="javascript">
<!--
funcion init(){
  makesnake ()
  pagestart ()
}
//-->
</script>

<body .... onload="init()">

xabi
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
xabiCommented:
Oubelkas yes, you are right, but I ususally try to do it in a function for easy reading, modifing, etc.

xabi
0
 
Q98Author Commented:
all this goes togather;
 onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll"

and all this goes togather; onLoad="pagestart();"
onUnload="if(brOK){stopme('joshhead');">

I have tried putting them togather with only one "onLoad=", which ever one I put first works, the second does not work.
0
 
oubelkasCommented:
what is that you want?

just do as I commented,

You had :

<BODY BGCOLOR="#OOOOOO" TEXT="#ffffff" LINK="#00ff40" VLINK="#C0C0C0" onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll" onLoad="pagestart();"
onUnload="if(brOK){stopme('joshhead');">

change this too :

<BODY BGCOLOR="#OOOOOO" TEXT="#ffffff" LINK="#00ff40" VLINK="#C0C0C0" onLoad="makesnake();pagestart();" style="width:100%;overflow-x:hidden;overflow-y:scroll" onUnload="if(brOK){stopme('joshhead');">  

Joseph
0
 
oubelkasCommented:
Not trying to sound rude, by the way ;) I read the comment and it is like I'm some kinda bad teacher or so, sorry! :)
0
 
Q98Author Commented:
Here is the same page with both working;
http://www.geocities.com/myplanet2000/test.html
0
 
Q98Author Commented:
That's OK, that works, I wasn't sure how to add the rest of the code,
Thanks for posting the whole body tag.
0
 
oubelkasCommented:
So what's the problem? If they are both working?
What you should do for this I guess, is put the javascript functions in your test.html (thus your frameset) and then in the onLoad of the frameset call the two functions :

<FRAMESET COLS="50%,*" BORDER="3" FRAMEBORDER="3" FRAMESPACING="3" onLoad="makesnake();pagestart();" onUnload="if(brOK){stopme('joshhead');">

See if this is what you want then....

Joseph
0
 
oubelkasCommented:
Oh, cross-posted, didn't know you already accepted answer. Thanks! Forget the last comment please. ;)

Joseph
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.