This works in all browsers except IE. I have no idea why. Its just an ajax clock that ticks through the seconds.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Time Program Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready( function(){
zone = 'Africa/Djibouti';
ajaxTimeCall(zone, ajaxCallback);
});
function ajaxTimeCall(zone, callback) {
$.ajax({
type: 'get',
url: 'time.php',
context: this,
data: 'location=' + zone,
success: function (data){
var dataSplit = data.split(".");
var isDST = dataSplit[1];
var newTime = new Date(dataSplit[0]);
//console.log(newTime);
if(isNaN(newTime))
{
$('#clock_input').val("Timezone Not Recognized");
return;
}
$('#clock_input').val(newTime);
callback(isDST);
}
});
}
function ajaxCallback(isDST) {
setTimeout("ajaxTimeCall(zone, ajaxCallback)", 1000);
if (isDST == 1)
$('.DST').removeClass('noshow');
}
</script>
<style type="text/css">
.noshow { display: none;}
.DST {color: red; font-size: 14px;}
</style>
</head>
<body>
<h1> World Time Ajax Testing</h1>
<span class="DST noshow">(DST)</span>
<form name="test" action="">
<input id="clock_input" style="width: 175px; font-size: 14px;" type="text" value="Turn on Javascript" />
</form>
</body>
</html>