/    Sign up×
Community /Pin to ProfileBookmark

help with timers??

hey everybody! i was wondering if any of you knew how to fix the timer that i have on my website, i website is a quiz for children and it asks a series of prompt questions, the problem is that the timer only starts after the questions have been asked. I would like the timer to start as soon as the page is loaded! The timer is situated in my status bar and i dont know if this is the problem?
my code is:
var gTimer1 = null;
var gTimer1Count = 0;

function Timer1()
{
gTimer1Count++;
window.status = “Timer1 Running – ” + gTimer1Count;
gTimer1 = window.setTimeout(“Timer1()”,1000);
}
Timer1();

can anybody help? please???

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorMay 26.2004 — [code=php]
var gTimer1 = null;
var gTimer1Count = 0;

function Timer1()
{
gTimer1Count++;
window.status = "Timer1 Running - " + gTimer1Count;
gTimer1 = window.setTimeout("Timer1()",1000);
}
window.onload=Timer1;
[/code]
Copy linkTweet thisAlerts:
@m_and_ms10authorJun 01.2004 — hey, sorry but i am new to this forum experience, the code you said didnt really work, the timer still only starts after the questions have been asked, i will post the page so that u can have a look, cheers

allan xox
×

Success!

Help @m_and_ms10 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,
)...