【发布时间】:2011-02-24 20:26:31
【问题描述】:
我使用 java 脚本显示时间。
function showTime()
{
setTimeout("showTime()", 500);
var now = new Date();
var f_date = now.getDate()+" "+strMonth(now.getMonth())+" "+now.getFullYear()+" / "+timeFormat(now.getHours(), now.getMinutes());
if (document.getElementById('foobar') == null)
{
showTime();
}
document.getElementById('foobar').innerHTML = f_date;
}
function strMonth(m)
{ ............ }
function timeFormat(curr_hour, curr_min)
{--------------}
showTime();
我的Browser 被吸,或者被无限绞死。这应该是什么原因?
没有 showClock() 只有 showTime().. 打字错误
【问题讨论】:
-
Browser是否报告任何 JavaScript 错误? -
我想我们需要看看“showClock()”是做什么的。
-
可能是 strMonth 或 timeFormat 对您的问题负责。你能展示一下这些函数的代码吗?
-
到目前为止很遗憾每一个答案都是错误的。
标签: javascript jquery datetime