|
|
|
|
Like this code?
Show the author your appreciation.
|
|
| |
This code makes the status bar of your web browser show a date like shown in the picture above.
doClock() calls the function doclock. The Window object supports methods for setting timers that we might use to perform a variety of functions. These methods include setTimeout() and clearTimeout(). The basic idea is to set a timeout to trigger a piece of script to occur at a particular time in the future. The general syntax is
| | timerId = setTimeout(script-to-execute, time-in-milliseconds); | |
Here
| window.setTimeout( "doClock()", 1000 );
today = new Date();
self.status = today.toString(); | |
After 1000 milliseconds windows.setTimeout() call to doClock(). The Date object provides a sophisticated set of methods for manipulating dates and times. And then it converted to string and display at status bar.
| <script language="JavaScript" type="text/javascript">
function doClock() {
window.setTimeout( "doClock()", 1000 );
today = new Date();
self.status = today.toString();
}
doClock()
</script> | | |
|
| Higly Customizable Javascript Calendar Script Categories : Java Script, Calendar, Date Time, HTML, CSS | | | Enchancing dd/mm/yyyy forms with unobtrusive javascript Categories : Java Script, HTML, User Interface, Date Time | | | Simple Javascript CSS Digital Clock Categories : Java Script, Date Time, CSS, Beginner Guides, Web Design | | | Builds JavaScript that updates the contents of one selector based on another. Categories : HTML, Java Script, PHP, Complete Programs, General | | | Java Script Based Navigation Categories : HTML, Java Script, Navigation | | | Javascript Background Scroller Categories : Java Script, CSS, HTML | | | How to create <SELECT> menues that change on the fly according to other <SELECT> menues on the page? Categories : Java Script, HTML | | | Javascript Date Picker Categories : Java Script, Date Time, Calendar | | | Calendars to choose a range of dates , reservation events ... Categories : PHP, Calendar, Java Script, Date Time | | | Java Script which implements a Clock (Client Side) Categories : Java Script, Date Time | | | Local Time clock and Server time usign PHP and JavaScript Categories : PHP, Java Script, Date Time, Beginner Guides | | | Prevent Right Mouse steal your graphics Categories : HTML, Java Script, Security | | | enhanced date picker with jcript checking for a dynamic date input Categories : PHP, Java Script, Date Time, Calendar, Arrays | | | Conditional Check - a script that allows a user to submit a form only if the user check a checkbox. Categories : HTML, Java Script, Form Processing, Beginner Guides | | | Javascript animated menu items Categories : DHTML, CSS, Java Script, HTML | |
|
|
|