Body OnLoad

S

Steve Easton

Multiple unloads yes.
Multiple body tags No.

However, if you want more cause than one function to run via onload
statements, it's better to call one function
in your script which then runs the other functions.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
J

Jon Spivey

Hi,
you must only have 1 body tag - but you can put as many onloads as you like
seperated by ; eg

<body onload="functionOne(); functionTwo();">
or an alternative
<script type="text/javascript">
// your functions
function doIt(){
functionOne();
functionTwo();
}
onload=doIt;
</script>

both do exactly the same thing - use whichever you prefer

Jon
Microsoft MVP - FP
 
A

Armond Perretta

JCO said:
Curious if you can have multiply onload statemts or multiply Body
tags?

Within the body tag and within the parentheses for the onload statement,
separate the multiple commands by a semicolon. You can also Google this one
for many examples.
 
J

JCO

Then curious...

Is their a difference when the tags are capitalized or in small case?
It seems I have both sets. These are blank pages with only a date & time
component. This site is new therefore, I can easliy make changes at this
point.

Thanks
 
T

Thomas A. Rowe

When working with JavaScript case is very important, it doesn't matter if you use upper, lower or
mixed case but if the function is called jco then onload must call the function as jco, not JCO,
etc.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
R

Ronx

For HTML all tags and attributes are case insensitive; for XHTML all tags
and attributes *must* be lower case.
 
J

JCO

Yes that makes sense.
Thanks

Thomas A. Rowe said:
When working with JavaScript case is very important, it doesn't matter if you use upper, lower or
mixed case but if the function is called jco then onload must call the function as jco, not JCO,
etc.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Top