Legal Real estate Insurance Website Hosting Travel Agents Internet & Phone Casino Sports Book Templates Expat Food Items Domain Names
Submit Engine Send e-Cards Shopping Mall Travel Guide Missing Persons Free Web Based E-mail Search The Web Webmaster Tools Dating Service Blog read now Play Flash Games
Free E-books Free Legal Forms Reference Programs Scripts Affilliate Videos Free Adsense Templates Erotic phone Java games
Send SMS to USA FAQ's & Advice Expat Profile Consumer Protection Testimonials Pattaya's WeatherThai Food Recipes Free Articles Free Magazines
Pattaya City Thailand, legal, real-estate and discount international telephone services

Webmaster Tips, Tricks & Utilities    JavaScripts & CSS Styling

      JavaScript Clock

The following JavaScript clock is easy to install and allows you to display the current hour, minute and second of the time. Unlike previous versions of this script, the script will work in Internet Explorer, Netscape Navigator, and Mozilla. All you have to do is paste this code into the <head> section of your website...

<script type="text/javascript">
function createtime()
{
var time = new Date()
var hours = time.getHours()
var minutes = time.getMinutes()
var seconds = time.getSeconds()
var abbrev = "AM"
if (hours>=12)
abbrev="PM"
if (hours>12)
{
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime=""+hours+":"+minutes+":"+seconds+" "+abbrev+""
if (document.all)
document.all.clock.innerHTML=ctime
else if (document.getElementById)
document.getElementById("clock").innerHTML=ctime
else
document.write(ctime) }
if (!document.all&&!document.getElementById)
createtime()
function loadtime()
{
if (document.all||document.getElementById)
setInterval("createtime()",1000)
}
</script>

With that in the HEAD section of your website, place the code shown in bold inside your body tag like shown, but don't add the body tag if you already have a body tag!

<body onLoad="loadtime()">

Finally, add this empty span to where you would like the clock to show up in your website:

<span id="clock"></span>

The span can be style with CSS to be visually enhanced. Save your changes and enjoy your new clock!

 

Pattaya City Thailand, legal, real-estate and discount international telephone services



Google