HighDots Forums  

using OnLoad in the <body> tag

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss using OnLoad in the <body> tag in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sez1
 
Posts: n/a

Default using OnLoad in the <body> tag - 08-28-2004 , 05:22 PM






HI,,

I've got a couple of questions about using Javasript in the <body> tag.

1) can you use "onLoad" to call more than 1 function? If so, how is
this done?

2) I use DW to generate rollover images as buttons. I am trying to set
up a script that would choose random buttons from a pool of button
images, but not sure how I would write the random variable into the
onLoad function in the body tag.

Example: DW generates a function like so (onLoad="MM_preloadImages
('images/pic1.gif','images/pic2.gif', ...) to be called by "onLoad" in
the body tag. If I want the randomly-generated image to be preloaded
this way, I'd have to write a reference to the picture variable to be
included in the MM_preloadImages function. THis is already exhausting
what little cerebral matter is still functioning in my cranium.

don't want to mess around with scripting the "body" tag in a
document.write statement.

can anyone give me any pointers for this dilemma?

thanks muchly,,,

Sez

Reply With Quote
  #2  
Old   
noone
 
Posts: n/a

Default Re: using OnLoad in the <body> tag - 09-01-2004 , 07:20 AM







"Sez1" <Sezzie (AT) sezzle (DOT) com> skrev i en meddelelse
news:MPG.1b9aa554555eaad598968a (AT) news (DOT) telus.net...
Quote:
HI,,

I've got a couple of questions about using Javasript in the <body> tag.

1) can you use "onLoad" to call more than 1 function? If so, how is
this done?

2) I use DW to generate rollover images as buttons. I am trying to set
up a script that would choose random buttons from a pool of button
images, but not sure how I would write the random variable into the
onLoad function in the body tag.

Example: DW generates a function like so (onLoad="MM_preloadImages
('images/pic1.gif','images/pic2.gif', ...) to be called by "onLoad" in
the body tag. If I want the randomly-generated image to be preloaded
this way, I'd have to write a reference to the picture variable to be
included in the MM_preloadImages function. THis is already exhausting
what little cerebral matter is still functioning in my cranium.

don't want to mess around with scripting the "body" tag in a
document.write statement.

can anyone give me any pointers for this dilemma?

thanks muchly,,,

Sez
Hi Sez

It is quite easy to call multiple functions on the onLoad event:

onload="function1(); function2();...."

happy coding
Robert




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.