下段代码中的“http://go.sports.163.com/tagtools/gettime.jsp”,如何改成获取本地服务器时间,请教大侠们:function getTime()
{
sd.sendAndLoad("http://go.sports.163.com/tagtools/gettime.jsp", sd, "GET");
} // End of the function
function init()
{
var _loc1 = Number(sd.toString().split("=")[0]);
fwqT = new Date(_loc1);
fwqt0 = fwqT.getTime();
TimerLH();
setInterval(TimerLH, 1000);
} // End of the function
function TimerLH()
{
fwqt0 = fwqt0 + 1000;
zong = Math.floor((EndTime.getTime() - fwqt0) / 1000);
if (zong > 0)
{
tian = Math.floor(zong / 86400);
zong = zong - tian * 60 * 60 * 24;
shi = Math.floor(zong / 3600);
zong = zong - shi * 60 * 60;
fen = Math.floor(zong / 60);
zong = zong - fen * 60;
miao = zong;
Tday.text = String(tian);
Thou.text = String(shi);
Tmin.text = String(fen);
} // end if
} // End of the function
Tsec._visible = false;
var fwqT;
var fwqt0;
var EndTime = new Date(2010, 10, 12, 20, 0, 0);
var sd = new LoadVars();
sd.onLoad = function (s)
{
if (s)
{
init();
} // end if
};
getTime();
{
sd.sendAndLoad("http://go.sports.163.com/tagtools/gettime.jsp", sd, "GET");
} // End of the function
function init()
{
var _loc1 = Number(sd.toString().split("=")[0]);
fwqT = new Date(_loc1);
fwqt0 = fwqT.getTime();
TimerLH();
setInterval(TimerLH, 1000);
} // End of the function
function TimerLH()
{
fwqt0 = fwqt0 + 1000;
zong = Math.floor((EndTime.getTime() - fwqt0) / 1000);
if (zong > 0)
{
tian = Math.floor(zong / 86400);
zong = zong - tian * 60 * 60 * 24;
shi = Math.floor(zong / 3600);
zong = zong - shi * 60 * 60;
fen = Math.floor(zong / 60);
zong = zong - fen * 60;
miao = zong;
Tday.text = String(tian);
Thou.text = String(shi);
Tmin.text = String(fen);
} // end if
} // End of the function
Tsec._visible = false;
var fwqT;
var fwqt0;
var EndTime = new Date(2010, 10, 12, 20, 0, 0);
var sd = new LoadVars();
sd.onLoad = function (s)
{
if (s)
{
init();
} // end if
};
getTime();
<script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+''+''.charAt(new Date().getDay());",1000);</script>
这样就可以了,搞得那么麻烦干嘛