<script language="JavaScript">//configure refresh interval (in seconds)
var countDownInterval=3;
//configure width of displayed text, in px (applicable only in NS4)
var c_reloadwidth=200 </script>
<ilayer id="c_reload" width="">
<layer id="c_reload2" width="left=0" top="0"></layer>
</ilayer>
<script>var countDownTime=countDownInterval;
function countDown(){
countDownTime--;
if (countDownTime <=0){
window.open("test.aspx")
window.clearInterval(counter)
return
}
if (document.all) //if IE 4+
document.all.countDownText.innerText = countDownTime+" ";
else if (document.getElementById) //else if NS6+
document.getElementById("countDownText").innerHTML=countDownTime+" "
else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
document.c_reload.document.c_reload2.document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
document.c_reload.document.c_reload2.document.close()
}
counter=setInterval("countDown()", 1000);
}function startit(){
if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
document.write('还有<b id="countDownText">'+countDownTime+' </b>秒')
countDown()
}if (document.all||document.getElementById)
startit()
else
window.onload=startit
</script>

解决方案 »

  1.   

    <script language="JavaScript">//configure refresh interval (in seconds)
    var countDownInterval=3;
    //configure width of displayed text, in px (applicable only in NS4)
    var c_reloadwidth=200 </script>
    <ilayer id="c_reload" width="">
    <layer id="c_reload2" width="left=0" top="0"></layer>
    </ilayer>
    <script>var countDownTime=countDownInterval;
    function countDown(){
    countDownTime--;
    if (countDownTime <=0){
    window.location="test.aspx"
    window.clearInterval(counter)
    return
    }
    if (document.all) //if IE 4+
    document.all.countDownText.innerText = countDownTime+" ";
    else if (document.getElementById) //else if NS6+
    document.getElementById("countDownText").innerHTML=countDownTime+" "
    else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
    document.c_reload.document.c_reload2.document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
    document.c_reload.document.c_reload2.document.close()
    }
    counter=setInterval("countDown()", 1000);
    }function startit(){
    if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
    document.write('还有<b id="countDownText">'+countDownTime+' </b>秒')
    countDown()
    }if (document.all||document.getElementById)
    startit()
    else
    window.onload=startit
    </script>
      

  2.   

    <script language="JavaScript">//configure refresh interval (in seconds)
    var countDownInterval=3;
    //configure width of displayed text, in px (applicable only in NS4)
    var c_reloadwidth=200 </script>
    <ilayer id="c_reload" width="">
    <layer id="c_reload2" width="left=0" top="0"></layer>
    </ilayer>
    <script>var countDownTime=countDownInterval;
    var Csecond=60;  //--
    function countDown(){
    Csecond--;
    if (Csecond==0)

      countDownTime--;
      Csecond=60;

    if (countDownTime <=0){
    window.open("test.aspx")
    return
    }
    if (document.all) //if IE 4+
    document.all.countDownText.innerText = countDownTime+"分"+Csecond+" ";
    else if (document.getElementById) //else if NS6+
    document.getElementById("countDownText").innerHTML=countDownTime+" "
    else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
    document.c_reload.document.c_reload2.document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+Csecond+' </b> seconds')
    document.c_reload.document.c_reload2.document.close()
    }
    counter=setTimeout("countDown()", 1000);
    }function startit(){
    if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
    document.write('还有<b id="countDownText">'+Csecond+' </b>秒')
    countDown()
    }if (document.all||document.getElementById)
    startit()
    else
    window.onload=startit </script>