/    Sign up×
Community /Pin to ProfileBookmark

Conceptual question about onLoad

Hello,

I have a function that will do something at onLoad time.
So, I’d have something like: <body onload=”doSomething()”>

Now, I need a second function to display the date/time in a 1000 ms interval.

The clock would be enclosed in a table 1×1 showing,say, date=yyyy/mm/dd hh:mm:ss.

QUESTION:
How do I set the clock in motion since my onLoad=”doSomething()” has already taken the place of the clock function?
I have seen a lot of clock examples but none answers my question.

[B]Thank you for any help[/B]

pako

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@nap0leonDec 22.2007 — Can you place a call to the clock function at the end of doSomething()?

[CODE]
function doSomething(){
whatever;
startClock();
}
[/CODE]


or add it to the onLoad events?
[CODE]
<body onLoad="doSomething();startClock();">
[/CODE]
Copy linkTweet thisAlerts:
@pakoauthorDec 22.2007 — Hello NapOleon, ?


I guess I can place them both as you suggested. I have not tested it yet because I don't know how to move the result of the "startClock()" inside a table 1x1 that is in the <body> part of the HTML code.


I'd like something like (please do not mind the way I write this example)

<body onLoad="...... :>

<table> [B]hh:mm:ss[/B]<table>

Is it ask too much if you could help me out here?

ALL my work will use some sort of settings as above and I'm stuck.

Thanks you and [COLOR="Red"]Happy Holidays[/COLOR]

pako
×

Success!

Help @pako spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...