More work on the digital clock code! Missouri

Today we begin playing around with replacing those image tags with the correct numbers, depending on what time it is.

Local Companies

Punch Software LLC
816-891-0025
7900 NW 100th St
Kansas City, MO
Trabon Solutions
816-926-9800
420 E Bannister RD
Kansas City, MO
Drafix Software
816-842-4955
114 W 3rd St
Kansas City, MO
Client Server Solutions Inc
314-523-4400
2008 Altom CT
St. Louis, MO
Open Software Technology
314-854-9138
7777 Bonhomme Ave
St. Louis, MO
Quest Software Inc
314-523-4400
2008 Altom CT
St. Louis, MO
Wonderware Central
888-676-9933
Two City Place Drive
St. Louis, MO
STL EHR Group
314-477-7459
689 Craig Road
Creve Coeur, MO
Amgraf Inc
816-474-4797
1501 Oak St
Kansas City, MO
Digital Consulting & Software
314-682-2350
12655 Olive Blvd
St. Louis, MO

provided by: 
Originally published at Internet.com


Tips...

Last week we learned the NAMEs attached to each of the HTML image tags. Today we begin playing around with replacing those image tags with the correct numbers, depending on what time it is.

Here's the code

The time is grabbed from the user's browser, so there's no need to worry about daylight savings time or time zones. As long as the viewer has his or her browser set correctly, you're good to go. If they don't, well, you can't help that.

Let's start at the top of the script just below the loading loop and code: function clock() { dates=new Date(); hour=dates.getHours(); min=dates.getMinutes(); sec=dates.getSeconds(); if(hour < 12) { amPM=am.src; } if(hour > 11) { amPM=pm.src; hour=hour-12; } if(hour == 0) { hour=12; } if(hour < 10) { document["tensHour"].src="http://www.developer.com/dgtbl.gif"; document["Hour"].src=d[hour].src; } if(hour > 9) { document["tensHour"].src=d[1].src; document["Hour"].src=d[hour-10].src; } if(min < 10) { document["tensMin"].src=d[0].src; } if(min > 9) { document["tensMin"].src=d[parseInt(min/10,10)].src; } document["Min"].src=d[min%10].src; if(sec < 10) { document["tensSec"].src=d[0].src; } if(sec > 9) { document["tensSec"].src=d[parseInt(sec/10,10)].src; } document["Sec"].src=d[sec%10].src; document["amPM"].src=amPM; setTimeout("clock();",100); } ...

Read article at Internet.com site

Featured Local Company

Punch Software LLC

816-891-0025
7900 NW 100th St
Kansas City, MO

Regional Articles
- More work on the digital clock code! Arnold MO
- More work on the digital clock code! Ballwin MO
- More work on the digital clock code! Belton MO
- More work on the digital clock code! Blue Springs MO
- More work on the digital clock code! Bolivar MO
- More work on the digital clock code! Branson MO
- More work on the digital clock code! Cape Girardeau MO
- More work on the digital clock code! Chesterfield MO
- More work on the digital clock code! Columbia MO
- More work on the digital clock code! De Soto MO
- More work on the digital clock code! Excelsior Springs MO
- More work on the digital clock code! Fenton MO
- More work on the digital clock code! Festus MO
- More work on the digital clock code! Florissant MO
- More work on the digital clock code! Grandview MO
- More work on the digital clock code! Hannibal MO
- More work on the digital clock code! Hazelwood MO
- More work on the digital clock code! Independence MO
- More work on the digital clock code! Jefferson City MO
- More work on the digital clock code! Joplin MO
- More work on the digital clock code! Kansas City MO
- More work on the digital clock code! Kirksville MO
- More work on the digital clock code! Lebanon MO
- More work on the digital clock code! Lees Summit MO
- More work on the digital clock code! Liberty MO
- More work on the digital clock code! Maryland Heights MO
- More work on the digital clock code! Moberly MO
- More work on the digital clock code! Neosho MO
- More work on the digital clock code! Nixa MO
- More work on the digital clock code! O Fallon MO
- More work on the digital clock code! Pacific MO
- More work on the digital clock code! Park Hills MO
- More work on the digital clock code! Perryville MO
- More work on the digital clock code! Poplar Bluff MO
- More work on the digital clock code! Rolla MO
- More work on the digital clock code! Saint Ann MO
- More work on the digital clock code! Saint Charles MO
- More work on the digital clock code! Saint Joseph MO
- More work on the digital clock code! Saint Louis MO
- More work on the digital clock code! Saint Peters MO
- More work on the digital clock code! Sedalia MO
- More work on the digital clock code! Sikeston MO
- More work on the digital clock code! Springfield MO
- More work on the digital clock code! Warrensburg MO
- More work on the digital clock code! West Plains MO
Related Local Events
Ozarks Technical Community College Center for Workforce Development: IT Consortium Planning Meeting
Dates: 12/3/2009 - 12/3/2009
Location: Springfield Area Chamber of Commerce
Springfield, MO
View Details

60 Minutes to Success: WWW: Who, What and Where do I turn to for my IT needs
Dates: 10/7/2009 - 10/7/2009
Location: Springfield Area Chamber of Commerce
Springfield, MO
View Details

Girls in Science, Technology, Engineering and Mathematics: Exploring Opportunities and Opening Doors
Dates: 10/6/2009 - 10/6/2009
Location: Metropolitan Community College
Kansas City, MO
View Details

BarCampKC
Dates: 9/26/2009 - 9/26/2009
Location: JavaportKC
Kansas City, MO
View Details

Brain Food-Discover the 21st Century Virtual Office
Dates: 9/16/2009 - 9/16/2009
Location: World Trade Center Room
Kansas City, MO
View Details

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML