Wednesday, December 3, 2008

Re: [JavaScript] Time Duration

Dear Watson,

Just add a little bit.
I think its better for you visit www.w3scools.com.
Go to "learn javascript" section, then in "js timing". There is a kind of simulator for trying javascript code as you wish.
The main player in eachsec (tim's code) below is setTimeout. You have to know it well for modify the timer as you need.
About eachsec, its just name only, you may rename it whatever you like.

Thanx

RA - dreaming while learning


--- On Wed, 12/3/08, Watson L <phpmks@yahoo.com.sg> wrote:
From: Watson L <phpmks@yahoo.com.sg>
Subject: Re: [JavaScript] Time Duration
To: JavaScript_Official@yahoogroups.com
Date: Wednesday, December 3, 2008, 4:14 PM



Thanks for the answer. That's I want. But I am a beginner in javascript. Could you give me the javascript code for eachsec function ? Please assist me. Thx.

Best Regards,

Son

Tim Sabin <tim@timsabin. com> wrote: There's one more thing. Make sure that the variable that you have that

defines the timeout value for the page is defined *outside* of the

function.

--Tim Sabin

> Do you want to just show the user the current time? If so, all they

> have to do is look on their desktop. But, I don't think this is the

> case, so:

>

> 1) Define a function eachSec () that: a) updates your countdown

timer,

> b) does anything special when time runs out, and c) calls itself

with

> the line

> setTimeout ('eachSec ()', 1000);

> 2) In the <body> tag, add an onLoad event handler: onLoad="eachSec

()"

> This gets the timer going.

>

> That's it. There's not much to a timed page.

>

> --Tim Sabin

>

>

> > Dear all,

> >

> > I want to make online test, so every exam has a time duration. How

> to check the time and show that to the student every second.

Please

> assist me... Thx.

> >

> > Best Regards,

> >

> > Son

> >

> >

> > ------------ --------- --------- ---

> > Get your preferred Email name!

> > Now you can @ymail.com and @rocketmail. com.

> >

> > [Non-text portions of this message have been removed]

> >

> >

> > ------------ --------- --------- ------

> >

> > Visit http://aiaiai. com for more groups to joinYahoo! Groups Links

> >

> >

> >

> >

>

>

> ------------ --------- --------- ------

>

> Visit http://aiaiai. com for more groups to joinYahoo! Groups Links

>

>

>

>

------------ --------- --------- ---

Get your preferred Email name!

Now you can @ymail.com and @rocketmail. com.

------------ --------- --------- ---

New Email names for you!

Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail.

Hurry before someone else does!

[Non-text portions of this message have been removed]











[Non-text portions of this message have been removed]


------------------------------------

Visit http://aiaiai.com for more groups to joinYahoo! Groups Links

<*> To reply to this message, go to:
http://groups.yahoo.com/group/JavaScript_Official/post?act=reply&messageNum=16502
Please do not reply to this message via email. More information here:
http://help.yahoo.com/help/us/groups/messages/messages-23.html

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/JavaScript_Official/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:JavaScript_Official-digest@yahoogroups.com
mailto:JavaScript_Official-fullfeatured@yahoogroups.com

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/JavaScript_Official/

<*> To unsubscribe from this group, send an email to:
JavaScript_Official-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

0 comments: