473,545 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

question about Onload function ?

question about Onload function

can one define more than one function for Onload ?
<body Onload="functio n1()">
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 8131
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="functio n1()">
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
4900
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;
5
3383
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
2158
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? Regards, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>
2
7665
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 like mine to run immediately after it. So in the code below, what JS would i need to add to my "myfile.inc" page so that I could guarantee this...
3
1777
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 in header, thus: window.onload=function1;function2; but I just realized that only first function in this list gets called
3
4185
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'); x.setAttribute("language", "javascript"); x.setAttribute("type", "text/javascript"); x.innerHTML ="window.load = parent.al();";...
6
1184
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 gets loaded. He uses the ID property,BUT he never actually calls the function: The Markup: <ul id="imagegallery"> <li>
20
11839
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 (i=0;i<obj.length;i++) { obj.attachEvent('ondrag', noDrag); }
1
8146
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 functionality to force the flash file to jump to a labeled frame on load. This is the Javascript in the head of the html file: <!-- function...
0
7398
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
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. ...
0
7805
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7752
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5969
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...
1
5325
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...
0
4944
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...
0
3449
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...
1
1878
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

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.