473,385 Members | 1,766 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,385 software developers and data experts.

question about Onload function ?

question about Onload function

can one define more than one function for Onload ?
<body Onload="function1()">
or can one define multiple functions one after another
like <body Onload="f() g() h()" ???

is there an equivalent function like sleep() in javascript ? so that one
can delay executions of statements via the sleep ?
Jul 20 '05 #1
2 8126
brian wrote:
or can one define multiple functions one after another
like <body Onload="f() g() h()" ???


Yes... but only in the same way that you would usually execute multiple
functions in sequence (by seperating them with the end of statement
character ";")

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #2
Lee
brian said:

question about Onload function

can one define more than one function for Onload ?
<body Onload="function1()">
or can one define multiple functions one after another
like <body Onload="f() g() h()" ???

is there an equivalent function like sleep() in javascript ? so that one
can delay executions of statements via the sleep ?


The value of the onLoad attribute is interpretted as the body of
the onload function. Like any other function, it can contain
several other function calls, separated by semi-colons:

onload="f();g();h()"

Event driven systems like web pages and other GUI interfaces generally
don't provide a sleep(). You always want to be able to detect mouse
and keyboard activity. Instead, you use setTimeout() to schedule some
code to be executed after a delay (specified in milliseconds):

onload="f();g();setTimeout('h()',60000)"


Jul 20 '05 #3

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');...
5
by: judy | last post by:
Hi all, I need to run two functions from the onLoad event. I prefer not combine them into a single funciton. Any suggestions on the onLoad syntax?
9
by: beguigne | last post by:
Below is a snippet of a crude date picking routine for a form. I am a novice at this so, I am hitting my head at why when I select the day, the onChange event gives me a blank. What am I missing?...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
3
by: Frances | last post by:
I have three functions I need triggered when page loads, so have <body onload="function1();function2();function3()"> but I want to take all these function calls out of body tag and call them...
3
by: Alex | last post by:
I am trying to insert Javascript code with grease monkey so it would insert to a page a call to a parent frame function al() I tried (portion of the code): x.document.createElement('script');...
6
by: ampeloso | last post by:
Hello, I have been Reading the DOM Scripting book by FriendsofEd and have a question. He separates the the OnClick event from the href by putting it in a js file that gets loaded when the page...
20
by: Mark Anderson | last post by:
Hi, I have this in an external JS library: ///////////////////////// function addMyEvent(){ var obj; if(document.attachEvent) { obj = document.getElementsByTagName('img'); for...
1
by: zebra242 | last post by:
I'm working to get the onLoad function of a javascript to work: the script allows form buttons in html to refer to labeled frames in flash. Which works fine. Now I want to add onLoad...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.