More work on the digital clock code! Connecticut

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

Local Companies

Media Lantern Inc,
(800) 705-1213
236 State Street
New London, CT
Nandvarik Systems
999-999-9999
Farmington
Hartford, CT
Microsoft
(860) 916-7448
74 Batterson Park Rd., Ste. 100
Farmington, CT
OFFiS Corporation
203-265-6700
61 N Plains Industrial Rd
Wallingford, CT
Tamion Company
800-582-9637
1178 Mill Street
East Berlin, CT
GoECart
203 336 2284
Park City Plaza, 10 Middle Street
Bridgeport, CT
Coordinated Systems, Inc.
860-289-2151
165 Burnside Avenue
East Hartford, CT
Icxpress Inc
(203) 925-9700
1 Corporate Dr
Shelton, CT
Omega Consulting
(203) 762-9244
Wilton, CT
Catapult
(203) 453-1627
40 Stillmeadow Dr
Guilford, CT

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

Media Lantern Inc,

(800) 705-1213
236 State Street
New London, CT

Regional Articles
- More work on the digital clock code! Ansonia CT
- More work on the digital clock code! Bethel CT
- More work on the digital clock code! Branford CT
- More work on the digital clock code! Bridgeport CT
- More work on the digital clock code! Bristol CT
- More work on the digital clock code! Cheshire CT
- More work on the digital clock code! Danbury CT
- More work on the digital clock code! East Hartford CT
- More work on the digital clock code! East Haven CT
- More work on the digital clock code! Enfield CT
- More work on the digital clock code! Glastonbury CT
- More work on the digital clock code! Greenwich CT
- More work on the digital clock code! Groton CT
- More work on the digital clock code! Guilford CT
- More work on the digital clock code! Hamden CT
- More work on the digital clock code! Hartford CT
- More work on the digital clock code! Manchester CT
- More work on the digital clock code! Meriden CT
- More work on the digital clock code! Middletown CT
- More work on the digital clock code! Milford CT
- More work on the digital clock code! Naugatuck CT
- More work on the digital clock code! New Britain CT
- More work on the digital clock code! New Canaan CT
- More work on the digital clock code! New Haven CT
- More work on the digital clock code! New London CT
- More work on the digital clock code! Newington CT
- More work on the digital clock code! North Haven CT
- More work on the digital clock code! Norwalk CT
- More work on the digital clock code! Norwich CT
- More work on the digital clock code! Plainville CT
- More work on the digital clock code! Ridgefield CT
- More work on the digital clock code! Rocky Hill CT
- More work on the digital clock code! Shelton CT
- More work on the digital clock code! Simsbury CT
- More work on the digital clock code! South Windsor CT
- More work on the digital clock code! Southbury CT
- More work on the digital clock code! Southington CT
- More work on the digital clock code! Stamford CT
- More work on the digital clock code! Storrs Mansfield CT
- More work on the digital clock code! Stratford CT
- More work on the digital clock code! Torrington CT
- More work on the digital clock code! Trumbull CT
- More work on the digital clock code! Vernon Rockville CT
- More work on the digital clock code! Wallingford CT
- More work on the digital clock code! Waterbury CT
- More work on the digital clock code! West Hartford CT
- More work on the digital clock code! West Haven CT
- More work on the digital clock code! Westport CT
- More work on the digital clock code! Wethersfield CT
- More work on the digital clock code! Willimantic CT
- More work on the digital clock code! Wilton CT
- More work on the digital clock code! Windsor CT
- More work on the digital clock code! Winsted CT
- More work on the digital clock code! Wolcott CT
Related Local Events
The New Balancing Act
Dates: 11/5/2009 - 11/5/2009
Location: Acton Public Library
Old Saybrook, CT
View Details

The New Balancing Act
Dates: 11/3/2009 - 11/3/2009
Location: Estuary Council of Seniors
Old Saybrook, CT
View Details

Discover SW Technology sub-committee
Dates: 8/20/2009 - 8/20/2009
Location: South Windsor Chamber of Commerce
South Windsor, CT
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