<
HTML
>
<
HEAD
>
<
Title
>
ASDF
Title
>
<
Script
Language
= JavaScript>
= "1: 2: 10"
Var parselimit
= Limit.split (":");
Totallimit
= PARSELIMIT [0] * 3600 PARSELIMIT [1] * 60 PARSELIMIT [2] * 1;
/ / Conversion into second function based begintimer () {ix (TotallImit <
= 0)
{Alert ("Please pay attention to rest!"); // limit time to processes} else {CURHOUR
= Math.floor (TotallImit / 3600);
Curmin
= Math.floor ((TotallImit-Curhour * 3600) / 60);
CURSEC
= Math.Floor (TotallImit-Curhour * 3600-Curmin * 60)
Timeleft
= "Left only"
CURHOUR "Hours" Curmin "Minute" CURSEC "SecuMent.Lefttime.Left.Value
= Timeleft;
Totallimit ---; Window.SetTimeout ("Begintimer ();", 1000);}} //
>
Script
>
HEAD
>
<
Body
Online
= "begintimer ();"
>
<
FORM
Name
= "Lefttime"
>
<
INPUT
Type
= "text"
Name
= "Left"
>
FORM
>
Body
>
HTML
>
Note: Differences in the article "Settimeout and SetInterval in JS"
(URL: http://www.cnblogs.com/heroman/archive/
2005/03/16
In /119660.html, I learned the SETINTERVAL method. I feel that Items may be simpler than setTimeout, so I will try it immediately. I found a message box for each second after it. I can't get rid of it, I am bother, I know that the two have advantages and disadvantages, how to use it, to see the specific situation.