473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Multiple onload events in the bidy tag

Hi

is it possible to load multiple onload events in the body tag?

Regards

Jun 22 '07 #1
6 4665
Michael Landberg wrote on 22 jun 2007 in comp.lang.javascript:
is it possible to load multiple onload events in the body tag?
onload events are not "loaded" themselves.

<body onload='action1();action2();'>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 22 '07 #2
On 22 jun, 10:47, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
Michael Landberg wrote on 22 jun 2007 in comp.lang.javascript:
is it possible to load multiple onload events in the body tag?

onload events are not "loaded" themselves.

<body onload='action1();action2();'>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Hi

Yes, excuse me for not making myself clear. I meant ofcourse calling
multiple functions from the body event.
But thank you for the answer.

Jun 22 '07 #3
ed
A better way would be to attach an event to the body, and then simply
call one function:

function onLoadFunction () {
actionOne();
On Jun 22, 5:24 am, Michael Landberg <goodmin...@hotmail.comwrote:
On 22 jun, 10:47, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
Michael Landberg wrote on 22 jun 2007 in comp.lang.javascript:
is it possible to load multiple onload events in the body tag?
onload events are not "loaded" themselves.
<body onload='action1();action2();'>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Hi

Yes, excuse me for not making myself clear. I meant ofcourse calling
multiple functions from the body event.
But thank you for the answer.

Jun 22 '07 #4
ed
You could also just attach a function to onload that calls two or more
actions:

<body onload="onLoadFunction();">

function onLoadFunction() {
actionOne();
actionTwo();
Jun 22 '07 #5
ed wrote on 22 jun 2007 in comp.lang.javascript:
On Jun 22, 5:24 am, Michael Landberg <goodmin...@hotmail.comwrote:
>On 22 jun, 10:47, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
Michael Landberg wrote on 22 jun 2007 in comp.lang.javascript:
is it possible to load multiple onload events in the body tag?
onload events are not "loaded" themselves.
<body onload='action1();action2();'>
>Yes, excuse me for not making myself clear. I meant ofcourse calling
multiple functions from the body event.
But thank you for the answer.
[Please do not toppost on usenet]
You could also just attach a function to onload that calls two or more
actions:

<body onload="onLoadFunction();">

function onLoadFunction() {
actionOne();
actionTwo();
.
.
.
actionOneHundred();
}
Indeed you could, but should the OP?
Keeps more JS out of the HTML which is cleaner.
An argument, be it a subjective one, not really related to the OQ.
You should also think
You could, should the OP?
about attaching the events from inside the JS. You can use the code
here:

http://therealcrisp.xs4all.nl/upload/addEvent_dean.html
No, I don't think that is up to the OP's level.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 22 '07 #6
ed wrote on 22 jun 2007 in comp.lang.javascript:
On Jun 22, 5:24 am, Michael Landberg <goodmin...@hotmail.comwrote:
>On 22 jun, 10:47, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
Michael Landberg wrote on 22 jun 2007 in comp.lang.javascript:
is it possible to load multiple onload events in the body tag?
onload events are not "loaded" themselves.
<body onload='action1();action2();'>
[please do not quote signatures]
>Yes, excuse me for not making myself clear. I meant ofcourse calling
multiple functions from the body event.
But thank you for the answer.
[Please do not toppost on usenet]
A better way would be to attach an event to the body, and then simply
call one function:

function onLoadFunction () {
actionOne();
Why would that be a "better" way?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 23 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pai | last post by:
hello there, I am trying to rersize the window it works find in IE but doea not work with mozilla window.attachEvent(onload,MWSOnLoad); window.onload = function (MWSOnLoad) { alert('hello');...
3
by: Liming | last post by:
Hi, Here is my situation. I have a textarea on the page. When the page loads, I need it to have some default text (which will be generated dynamically) so I did something like this ...
2
by: Emmanuel | last post by:
Hi, I'm working on a c# web app and require having some code which runs in the page Load event of each page and to be reusable in other web apps. So i decided to use a Class Library which...
2
by: Opa | last post by:
Hi, I have a form with a javacript function that I wish to call before the Page_Load event on the server side. The function is called in the onload of window (ie. window.onload = "myfunction()"...
4
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the...
3
by: Mike Cain | last post by:
Hi I have a JS library that I want others in my company to use that uses AttachEvent (etc) to add a method to the onLoad event so that it is called. Using this approach of course is good because...
3
by: quoclinh | last post by:
I have an aspx page with code behind that has the initial page load code happens many times as user perform different action on the page, such as select a drop down list. To be more clear,...
6
by: maria.iglesias.19 | last post by:
Hya, Is it possible to have onload events on elements other than the body tag ? Thanks in advance, Maria
3
by: zepdad | last post by:
I'm new to forum and am learning javascript. I appreciate your help and patience in advance. I run an image gallery website that uses an onload event called FitPic() to scale image and window sizes...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.