More work on the digital clock code! Alabama

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

Local Companies

Westglenn Software
205-870-3118
2100 Southbridge Pkwy
Birmingham, AL
Arbitron Inc
205-977-6100
3500 Colonnade Pkwy
Birmingham, AL
eClinicalworks EMR Software
+1-395-685-7896
218 Mount Holly
California, AL
Ihs Inc Software
205-408-1477
4945 Mountain View Pkwy
Birmingham, AL
Visual Solutions Inc
205-930-5540
2217 10th CT S
Birmingham, AL
J K Preg Illustration
(334) 613-9993
2704 Colonial Dr
Montgomery, AL
Priority Software
205-838-7061
9006 4th Ave S
Birmingham, AL
Achaia Solutions
205-437-9960
117 Narrows Creek DR
Birmingham, AL
Exact Software North America
205-980-5270
3000 Eagle Point Corporate DR
Birmingham, AL
J R M Software
205-982-1836
209 Royal Oaks DR
Birmingham, AL

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

Westglenn Software

205-870-3118
2100 Southbridge Pkwy
Birmingham, AL

Regional Articles
- More work on the digital clock code! Alabaster AL
- More work on the digital clock code! Albertville AL
- More work on the digital clock code! Alexander City AL
- More work on the digital clock code! Andalusia AL
- More work on the digital clock code! Anniston AL
- More work on the digital clock code! Arab AL
- More work on the digital clock code! Athens AL
- More work on the digital clock code! Atmore AL
- More work on the digital clock code! Auburn AL
- More work on the digital clock code! Bay Minette AL
- More work on the digital clock code! Bessemer AL
- More work on the digital clock code! Birmingham AL
- More work on the digital clock code! Boaz AL
- More work on the digital clock code! Brewton AL
- More work on the digital clock code! Clanton AL
- More work on the digital clock code! Cullman AL
- More work on the digital clock code! Daphne AL
- More work on the digital clock code! Decatur AL
- More work on the digital clock code! Dothan AL
- More work on the digital clock code! Enterprise AL
- More work on the digital clock code! Eufaula AL
- More work on the digital clock code! Fairhope AL
- More work on the digital clock code! Florence AL
- More work on the digital clock code! Foley AL
- More work on the digital clock code! Fort Payne AL
- More work on the digital clock code! Gadsden AL
- More work on the digital clock code! Guntersville AL
- More work on the digital clock code! Haleyville AL
- More work on the digital clock code! Hartselle AL
- More work on the digital clock code! Huntsville AL
- More work on the digital clock code! Jasper AL
- More work on the digital clock code! Madison AL
- More work on the digital clock code! Mobile AL
- More work on the digital clock code! Montevallo AL
- More work on the digital clock code! Montgomery AL
- More work on the digital clock code! Muscle Shoals AL
- More work on the digital clock code! Northport AL
- More work on the digital clock code! Opelika AL
- More work on the digital clock code! Pelham AL
- More work on the digital clock code! Pell City AL
- More work on the digital clock code! Phenix City AL
- More work on the digital clock code! Pinson AL
- More work on the digital clock code! Prattville AL
- More work on the digital clock code! Scottsboro AL
- More work on the digital clock code! Selma AL
- More work on the digital clock code! Semmes AL
- More work on the digital clock code! Sylacauga AL
- More work on the digital clock code! Talladega AL
- More work on the digital clock code! Theodore AL
- More work on the digital clock code! Trussville AL
- More work on the digital clock code! Tuscaloosa AL
- More work on the digital clock code! Tuscumbia AL
- More work on the digital clock code! Valley AL
- More work on the digital clock code! Wetumpka AL
Related Local Events
December 2009 Gulf Coast Technology Council Meeting
Dates: 12/16/2009 - 12/16/2009
Location: ITT Technical Institute
Mobile, AL
View Details

Going Green Awards
Dates: 10/1/2009 - 10/1/2009
Location: Sheraton
North Birmingham, AL
View Details

Java Jam
Dates: 9/10/2009 - 9/10/2009
Location: Hartselle Chamber of Commerce
Hartselle, AL
View Details

Farmers Telecommunications Cooperative:55th Annual Meeting
Dates: 8/1/2009 - 8/1/2009
Location: DeKalb County Schools Coliseum
Rainsville, AL
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