<script language = javascript >
function OnLoadForm()
{ hTimer = setTimeout('window.location.reload(true)',10000);
}
function OnEditText()
{
if(hTimer)
{clearTimeOut(hTimer);}
}</script>
function OnLoadForm()
{ hTimer = setTimeout('window.location.reload(true)',10000);
}
function OnEditText()
{
if(hTimer)
{clearTimeOut(hTimer);}
}</script>
<BODY background=./images/bk.jpg OnLoad = "return hTimer = OnLoadForm()" >
<textarea onkeydown=onEditText(hTimer)>
<script>
var hTimer;
function OnLoadForm()
{
var hTimer = window.setTimeout('window.location.reload(true)',120000);
loadpopup();
return hTimer;
}function OnEditText( hTimer )
{
if ( hTimer )
window.clearTimeOut(hTimer);
}
</script>
可是还是不可以,有那位高手可以为我解答一下吗?
<BODY background=./images/bk.jpg onLoad = "OnLoadForm()" >
<textarea onfocus="onEditText()" onblur="OnLoadForm()">
</textarea>
<script>
var hTimer
function OnLoadForm()
{
hTimer = window.setTimeout('window.location.reload(true)',2000);}function onEditText()
{
window.clearTimeout(hTimer);
}
</script>
问题还是没有解决关键是执行window.clearTimeout(hTimer);
时,系统提示:对象不支持此属性或方法!!
<BODY background=./images/bk.jpg onLoad = "OnLoadForm()" >
<textarea onfocus="onEditText()" onblur="OnLoadForm()">
</textarea>
<script>
var hTimer
function OnLoadForm()
{
hTimer = window.setTimeout('window.location.reload(true)',2000);}function onEditText()
{
if (hTimer)
window.clearTimeout(hTimer);
}
</script>
应该是其他的原因导致的吧。
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
<!--
var hTimer,hTimer1;
function Load(){
hTimer=setTimeout(fnTest,10000);
}
function fnTest(){
alert("Timeout");
}
function Edit(){
if(isNaN(hTimer1))
hTimer1=setTimeout(fnTest1,10000);
clearTimeout(hTimer);
}
function fnTest1(){
alert("KeyDown");
}
//-->
</SCRIPT></HEAD><BODY onload="Load()">
<input onkeydown="Edit()">
</BODY>
</HTML>