More work on the digital clock code! Michigan

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

Local Companies

Corporate IT Source
248-396-1573
6841 N. Rochester Rd.
Rochester Hills, MI
Cms Software
313-965-4775
500 Griswold St
Detroit, MI
Protocol Syst C
313-534-8773
18201 W 8 Mile Rd
Detroit, MI
All About Technology
313-962-2430
2727 2nd Ave
Detroit, MI
Computer Power Store
313-640-4681
15411 Mack Ave
Detroit, MI
L & M Office Products
313-861-5707
8514 W Mcnichols RD
Detroit, MI
Keane Inc
248-356-2000
3000 Northwestern St
Detroit, MI
Sync Technologies
313-963-5353
2727 2nd Ave
Detroit, MI
Woodwing USA
313-962-0542
615 Griswold St
Detroit, MI
PC Menders Computer Services
313-397-2713
18256 Grand River Ave
Detroit, MI

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

Corporate IT Source

248-396-1573
6841 N. Rochester Rd.
Rochester Hills, MI

Regional Articles
- More work on the digital clock code! Adrian MI
- More work on the digital clock code! Allegan MI
- More work on the digital clock code! Allen Park MI
- More work on the digital clock code! Alpena MI
- More work on the digital clock code! Ann Arbor MI
- More work on the digital clock code! Auburn Hills MI
- More work on the digital clock code! Battle Creek MI
- More work on the digital clock code! Bay City MI
- More work on the digital clock code! Belleville MI
- More work on the digital clock code! Benton Harbor MI
- More work on the digital clock code! Berkley MI
- More work on the digital clock code! Big Rapids MI
- More work on the digital clock code! Bloomfield Hills MI
- More work on the digital clock code! Brighton MI
- More work on the digital clock code! Burton MI
- More work on the digital clock code! Cadillac MI
- More work on the digital clock code! Canton MI
- More work on the digital clock code! Cheboygan MI
- More work on the digital clock code! Clarkston MI
- More work on the digital clock code! Clinton Township MI
- More work on the digital clock code! Clio MI
- More work on the digital clock code! Coldwater MI
- More work on the digital clock code! Commerce Township MI
- More work on the digital clock code! Comstock Park MI
- More work on the digital clock code! Davison MI
- More work on the digital clock code! Dearborn Heights MI
- More work on the digital clock code! Dearborn MI
- More work on the digital clock code! Detroit MI
- More work on the digital clock code! Dowagiac MI
- More work on the digital clock code! East Lansing MI
- More work on the digital clock code! Eastpointe MI
- More work on the digital clock code! Eaton Rapids MI
- More work on the digital clock code! Escanaba MI
- More work on the digital clock code! Farmington MI
- More work on the digital clock code! Fenton MI
- More work on the digital clock code! Ferndale MI
- More work on the digital clock code! Flat Rock MI
- More work on the digital clock code! Flint MI
- More work on the digital clock code! Flushing MI
- More work on the digital clock code! Fort Gratiot MI
- More work on the digital clock code! Fraser MI
- More work on the digital clock code! Garden City MI
- More work on the digital clock code! Gaylord MI
- More work on the digital clock code! Gladwin MI
- More work on the digital clock code! Grand Blanc MI
- More work on the digital clock code! Grand Haven MI
- More work on the digital clock code! Grand Ledge MI
- More work on the digital clock code! Grand Rapids MI
- More work on the digital clock code! Grandville MI
- More work on the digital clock code! Grosse Pointe MI
- More work on the digital clock code! Hamtramck MI
- More work on the digital clock code! Harper Woods MI
- More work on the digital clock code! Harrison Township MI
- More work on the digital clock code! Hazel Park MI
- More work on the digital clock code! Highland Park MI
- More work on the digital clock code! Hillsdale MI
- More work on the digital clock code! Holland MI
- More work on the digital clock code! Holly MI
- More work on the digital clock code! Holt MI
- More work on the digital clock code! Howell MI
- More work on the digital clock code! Hudsonville MI
- More work on the digital clock code! Inkster MI
- More work on the digital clock code! Ionia MI
- More work on the digital clock code! Jackson MI
- More work on the digital clock code! Jenison MI
- More work on the digital clock code! Kalamazoo MI
- More work on the digital clock code! Lake Orion MI
- More work on the digital clock code! Lansing MI
- More work on the digital clock code! Lapeer MI
- More work on the digital clock code! Lincoln Park MI
- More work on the digital clock code! Livonia MI
- More work on the digital clock code! Ludington MI
- More work on the digital clock code! Macomb MI
- More work on the digital clock code! Marquette MI
- More work on the digital clock code! Midland MI
- More work on the digital clock code! Monroe MI
- More work on the digital clock code! Mount Clemens MI
- More work on the digital clock code! Mount Morris MI
- More work on the digital clock code! Mount Pleasant MI
- More work on the digital clock code! Muskegon MI
- More work on the digital clock code! New Baltimore MI
- More work on the digital clock code! Niles MI
- More work on the digital clock code! Northville MI
- More work on the digital clock code! Novi MI
- More work on the digital clock code! Oak Park MI
- More work on the digital clock code! Okemos MI
- More work on the digital clock code! Owosso MI
- More work on the digital clock code! Petoskey MI
- More work on the digital clock code! Pinckney MI
- More work on the digital clock code! Plymouth MI
- More work on the digital clock code! Pontiac MI
- More work on the digital clock code! Port Huron MI
- More work on the digital clock code! Portage MI
- More work on the digital clock code! Redford MI
- More work on the digital clock code! Rochester MI
- More work on the digital clock code! Rockford MI
- More work on the digital clock code! Romulus MI
- More work on the digital clock code! Roseville MI
- More work on the digital clock code! Royal Oak MI
- More work on the digital clock code! Saginaw MI
- More work on the digital clock code! Saint Clair Shores MI
- More work on the digital clock code! Saint Johns MI
- More work on the digital clock code! Saline MI
- More work on the digital clock code! Sault Sainte Marie MI
- More work on the digital clock code! South Haven MI
- More work on the digital clock code! South Lyon MI
- More work on the digital clock code! Southfield MI
- More work on the digital clock code! Southgate MI
- More work on the digital clock code! Sterling Heights MI
- More work on the digital clock code! Sturgis MI
- More work on the digital clock code! Swartz Creek MI
- More work on the digital clock code! Taylor MI
- More work on the digital clock code! Temperance MI
- More work on the digital clock code! Three Rivers MI
- More work on the digital clock code! Traverse City MI
- More work on the digital clock code! Trenton MI
- More work on the digital clock code! Troy MI
- More work on the digital clock code! Utica MI
- More work on the digital clock code! Walled Lake MI
- More work on the digital clock code! Warren MI
- More work on the digital clock code! Waterford MI
- More work on the digital clock code! West Bloomfield MI
- More work on the digital clock code! Westland MI
- More work on the digital clock code! White Lake MI
- More work on the digital clock code! Wixom MI
- More work on the digital clock code! Wyandotte MI
- More work on the digital clock code! Wyoming MI
- More work on the digital clock code! Ypsilanti MI
- More work on the digital clock code! Zeeland MI
Related Local Events
Real-Time & Embedded Computing Conference-Detroit (RTECC)
Dates: 9/17/2009 - 9/17/2009
Location: Sterling Inn Banquet & Conference Center, Detroit
Sterling Heights, MI
View Details

A&WMA CONFERENCE & EXHIBITION
Dates: 6/16/2009 - 6/19/2009
Location: Marriott Hotel Detroit, Detroit
Detroit, MI
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