积极答复者
javascipt 对火狐的支持

问题
-
请问各路高中...
火狐下,是不是无法使用setTimeout?有什么可以代替吗?- 已移动 孟宪会Moderator 2009年9月21日 0:33 (发件人:ASP.NET 与 AJAX)
答案
-
-
支持window.setTimeout 和window.setInterval的 全名
- 已标记为答案 肖小勇Moderator 2009年9月20日 4:17
-
你好 可能是你自己的代码有问题 setTimeout是一个标准的方法
Evaluates an expression after a specified number of milliseconds has elapsed.
Syntax
iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])
Parameters
vCode Required. Variant that specifies the function pointer or string that indicates the code to be executed when the specified interval has elapsed. iMilliSeconds Required. Integer that specifies the number of milliseconds. sLanguage Optional. String that specifies one of the following values: JScript Language is JScript. VBScript Language is VBScript. JavaScript Language is JavaScript. Return Value
Integer. Returns an identifier that cancels the evaluation with the clearTimeout method.
Wenn ich dich hab’,gibt es nichts, was unerträglich ist.坚持不懈!http://hi.baidu.com/1987raymond- 已标记为答案 肖小勇Moderator 2009年9月20日 4:17
全部回复
-
-
支持window.setTimeout 和window.setInterval的 全名
- 已标记为答案 肖小勇Moderator 2009年9月20日 4:17
-
你好 可能是你自己的代码有问题 setTimeout是一个标准的方法
Evaluates an expression after a specified number of milliseconds has elapsed.
Syntax
iTimerID = window.setTimeout(vCode, iMilliSeconds [, sLanguage])
Parameters
vCode Required. Variant that specifies the function pointer or string that indicates the code to be executed when the specified interval has elapsed. iMilliSeconds Required. Integer that specifies the number of milliseconds. sLanguage Optional. String that specifies one of the following values: JScript Language is JScript. VBScript Language is VBScript. JavaScript Language is JavaScript. Return Value
Integer. Returns an identifier that cancels the evaluation with the clearTimeout method.
Wenn ich dich hab’,gibt es nichts, was unerträglich ist.坚持不懈!http://hi.baidu.com/1987raymond- 已标记为答案 肖小勇Moderator 2009年9月20日 4:17
-
<script language="javascript" type="text/javascript">
document.all.Agree.disabled=true;
var wait = 10;
for(var i=10;i>=0;i--) {
window.setTimeout("doUpdate(" + i + ")", i * 1000);
}
function doUpdate(num) {
if(num != wait) {
wut = wait-num;
document.all.Agree.value = "同意(" + wut + ")";
}
else
{
document.all.Agree.disabled=false;
document.all.Agree.value = "同意";
}
}
</script>
呵呵,就是个简单的计时,刚看javascript,别见笑,能改改吗? -
-
不行额,火狐下...
<script language="javascript" type="text/javascript">
document.getElementById("Agree").disabled = true ;
var wait = 10;
for (var i = 10; i >= 0; i--) {
window.setTimeout("doUpdate(" + i + ")", i * 1000);
}
function doUpdate(num) {
if (num != wait) {
wut = wait - num;
document.getElementById("Agree").value = "同意(" + wut + ")";
}
else {
document.getElementById("Agree").disabled = false;
document.getElementById("Agree").value = "同意";
}
}
</script> -
window.onload =function() {
document.getElementById("Agree").disabled = true ;
var wait = 10;
for (var i = 10; i >= 0; i--) {
window.setTimeout("doUpdate(" + i + ")", i * 1000);
}
function doUpdate(num) {
if (num != wait) {
wut = wait - num;
document.getElementById("Agree").value = "同意(" + wut + ")";
}
else {
document.getElementById("Agree").disabled = false;
document.getElementById("Agree").value = "同意";
}
}}- 已建议为答案 mldark 2009年9月20日 13:52