Ðóññêèé | Óêðà¿íñüêà Donetsk national technical university


         On the given page JavaScript is located, with help of which the current date and time are deduced in a line of a condition.
         Text of JavaScript:
 
function TimeFunction() {
var now;
var strng, day;
now=new Date();
dte=now.getDate();
if (dte<10) { dte="0"+dte;}
mnth=now.getMonth()+1;
if (mnth<10) { mnth="0"+mnth;}
strng=dte+"-"+mnth+"-"+(now.getYear())+",";
switch(now.getDay()) {
  case 0: day="Sunday";break;
  case 1: day="Monday";break;
  case 2: day="Tuesday";break;
  case 3: day="Wednesday";break;
  case 4: day="Thursday";break;
  case 5: day="Friday";break;
  case 6: day="Saturday";break;}
hrs=now.getHours();
if (hrs<10) { hrs="0"+hrs;}
min=now.getMinutes();
if (min<10) { min="0"+min;}
sec=now.getSeconds();
if (sec<10) { sec="0"+sec;}
strng=strng+" "+day+"  "+hrs+":"+min+":"+sec;
window.status=strng;
return strng;
}
var d;
d=TimeFunction();
window.setInterval("d=TimeFunction()",1000);
The given function is carried out for once in a second. It is provided with the help of a method window.setInterval(A,B,[C]), where:
  • À - Name of function, which is carried out
  • B - a time interval in milliseconds
  • C - language on which function is written
    (Unessential parameter).


Main




    Animation:



  1. The drawn banners:
  2. The photographic banners:


Here is little test for you




Rambler's Top100