怎样在asp.net 中弹出一个窗口,窗口内容为时间倒计时,几秒后自动跳转到指定 页面

解决方案 »

  1.   

    window.open("anotherPage.htm")在anotherPage.htm中用setTimeout("this.location.href=''",5000)
      

  2.   

    好像跟asp.net 没有什么关系
      

  3.   

    windwo.open("mu.html");mu.html
    <script language="javascript">
    var i = 1;
    var a = 0;
    function disp(){
    if(i>1){
    i=0;
    }
    var shuzu2 = new Array(":"," ");
    var shuzu = new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");
    var time = new Date();
    var year = time.getYear();
    var month = time.getMonth();
    var date = time.getDate();
    var weekday = time.getDay();
    var hour = time.getHours();
    var second = time.getSeconds();
    var minute = time.getMinutes();
    if(second<10){
    second="0"+second;
    }
    if(minute<10){
    minute="0"+minute;
    }


    var xianshi;
    if(hour>=0 && hour<=12){
    xianshi="上午";
    }else if(hour >12 && hour <=18){
    xianshi="下午";
    }else{
    xianshi="晚上";
    }
    if(hour>=12){
    hour=hour-12;
    }

    var mytime = "当前时间:"+year+"年"+(month+1)+"月"+date+"日  "+shuzu[weekday]+"    "+hour+shuzu2[i]+minute+shuzu2[i]+second+"  "+xianshi;

    setTimeout("disp()",500);
    i++;

    document.getElementById("xxxxx").innerHTML="<h2><font size='5', color='red'>"+mytime+"</font></h2>";
    document.getElementById("zzz").innerText=mytime;
    document.getElementById("bbb").innerText=mytime;
    document.aaa.xhxm.value=mytime;

    var xhxm = "zhen de hao xi huan ni, xiaomin!!!";
    window.status=xhxm.substring(0,a);
    a++;
    if(a==xhxm.length+1){
    a=0;
    }

    }
    </script>