Body OnLoad

  • Thread starter Thread starter JCO
  • Start date Start date
J

JCO

Curious if you can have multiply onload statemts or multiply Body tags?
 
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
 
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
 
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.
 
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
 
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.
==============================================
 
For HTML all tags and attributes are case insensitive; for XHTML all tags
and attributes *must* be lower case.
 
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.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top