473,608 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4683
Michael Landberg wrote on 22 jun 2007 in comp.lang.javas cript:
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.net wrote:
Michael Landberg wrote on 22 jun 2007 in comp.lang.javas cript:
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...@hot mail.comwrote:
On 22 jun, 10:47, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
Michael Landberg wrote on 22 jun 2007 in comp.lang.javas cript:
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="onLoadF unction();">

function onLoadFunction( ) {
actionOne();
actionTwo();
Jun 22 '07 #5
ed wrote on 22 jun 2007 in comp.lang.javas cript:
On Jun 22, 5:24 am, Michael Landberg <goodmin...@hot mail.comwrote:
>On 22 jun, 10:47, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
Michael Landberg wrote on 22 jun 2007 in comp.lang.javas cript:
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="onLoadF unction();">

function onLoadFunction( ) {
actionOne();
actionTwo();
.
.
.
actionOneHundre d();
}
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.javas cript:
On Jun 22, 5:24 am, Michael Landberg <goodmin...@hot mail.comwrote:
>On 22 jun, 10:47, "Evertjan." <exjxw.hannivo. ..@interxnl.net wrote:
Michael Landberg wrote on 22 jun 2007 in comp.lang.javas cript:
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
4904
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'); window.resizeTo(810,750); top.outerWidth=810;
3
10188
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 function init() {
2
1508
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 contains a class that inherits from the System.Web.UI.Page. the class contains an override of the OnLoad event in which the common code is executed.
2
3126
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()" Is this possible? If so how, If not is there a workaround ?
4
2457
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 value of an option in a select statement: <select id="usertypes" multiple="multiple"> <option value="0033">data1</option>
3
4245
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 then my onLoad event does not clobber that of others programmers in my company that may be already using onLoad for something else (in this case both their onLoad event and mine will fire). However I'm finding that in some cases it is important...
3
12315
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, consider the following code: protected override void Page_Load(object sender, EventArgs e) { if (!IsPostBack) {
6
19776
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
2066
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 to fit the users monitor resolution. FitPic() creates certain variables that would be useful for other calculations, such as reporting the % of image scaling. However, since onload events occur last during rendering, the variables are not...
0
8472
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8130
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6805
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3954
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2464
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1574
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1318
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.