More work on the digital clock code! Mississippi

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

Local Companies

Driver Technology Consulting, LLC
601 316-1692
445 Greenmont Drive
Jackson, MS
i.t.works
(601) 264-0969
6641 hwy 98 west
hattiesburg, MS
Inacom Information Systems
(601) 362-4272
1920 Dunbarton Dr
Jackson, MS
Infinite Concepts Llcr
(662) 335-3513
537 Highway 82 E Ste 211
Greenville, MS
Third Day Solutions Llc
(601) 847-9301
218 N West St
Mendenhall, MS
Consultrix Technologies
(601) 206-4624
405 Legacy Park
Ridgeland, MS
Logista
(601) 362-4272
1920 Dunbarton Dr
Jackson, MS
Software Plus
(601) 634-8496
3402 Wisconsin Ave Ste 10
Vicksburg, MS
Ciber Inc
(601) 957-5131
3900 Lakeland Dr
Flowood, MS
Third Day Solutions Llc
(601) 957-7200
6360 I
Jackson, MS

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

Driver Technology Consulting, LLC

601 316-1692
445 Greenmont Drive
Jackson, MS
www.dtc-ms.com

Regional Articles
- More work on the digital clock code! Bay Saint Louis MS
- More work on the digital clock code! Biloxi MS
- More work on the digital clock code! Booneville MS
- More work on the digital clock code! Brandon MS
- More work on the digital clock code! Byhalia MS
- More work on the digital clock code! Clarksdale MS
- More work on the digital clock code! Clinton MS
- More work on the digital clock code! Columbus MS
- More work on the digital clock code! Corinth MS
- More work on the digital clock code! Gautier MS
- More work on the digital clock code! Greenville MS
- More work on the digital clock code! Greenwood MS
- More work on the digital clock code! Grenada MS
- More work on the digital clock code! Gulfport MS
- More work on the digital clock code! Hattiesburg MS
- More work on the digital clock code! Hernando MS
- More work on the digital clock code! Holly Springs MS
- More work on the digital clock code! Horn Lake MS
- More work on the digital clock code! Jackson MS
- More work on the digital clock code! Laurel MS
- More work on the digital clock code! Lucedale MS
- More work on the digital clock code! Mccomb MS
- More work on the digital clock code! Meridian MS
- More work on the digital clock code! Moss Point MS
- More work on the digital clock code! Natchez MS
- More work on the digital clock code! Ocean Springs MS
- More work on the digital clock code! Olive Branch MS
- More work on the digital clock code! Oxford MS
- More work on the digital clock code! Pascagoula MS
- More work on the digital clock code! Pass Christian MS
- More work on the digital clock code! Pearl MS
- More work on the digital clock code! Petal MS
- More work on the digital clock code! Picayune MS
- More work on the digital clock code! Pontotoc MS
- More work on the digital clock code! Ridgeland MS
- More work on the digital clock code! Southaven MS
- More work on the digital clock code! Starkville MS
- More work on the digital clock code! Tupelo MS
- More work on the digital clock code! Vicksburg MS
- More work on the digital clock code! West Point MS
- More work on the digital clock code! Yazoo City MS
Related Local Event
OCEANS 2009
Dates: 10/27/2009 - 10/29/2009
Location: Mississippi Coast Coliseum and Convention Center
Biloxi, MS
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