【发布时间】:2011-10-05 15:25:54
【问题描述】:
<script language="JavaScript" type="text/javascript">
var theBar = createProgressBar(document.getElementById('progress-bar'));
var value;
function resetValue() {
value = 0;
}
function showProgress() {
value += 1;
theBar.setValue(value);
if (value < 100) {
window.setTimeout(showProgress, 100);
}
if (value = 100) {
window.location = 'http://google.com';
}
}
window.onload=resetValue();showProgress();
</script>
我正在尝试在计时器达到 10 秒后重定向,但我尝试的方法似乎不起作用(立即重定向)。
对JS有点不熟悉,尽量模仿
【问题讨论】:
标签: javascript redirect timer window.location