は、だからここに私のスクリプト スクリプトが未定義印刷し
function updateClock() {
var now = new Date(); // current date
var time = now.getHours() + ':' + now.getMinutes(); // again, you get the idea
// a cleaner way than string concatenation
// set the content of the element with the ID time to the formatted string
document.getElementById('nav-time').innerHTML = time;
// call this function again in 1000ms
setTimeout(updateClock, 1000);
}
<li><span id="nav-time">Time
<script>document.write(updateClock());</script></span></li>
<span class="divider"> | </span>
undefined
を持っています
12:12undefined
のような時間文字列の終わり。
あなただけが1秒よりもここにはるかに長い間隔を使用することができます分をしたい場合。 –