zoukankan      html  css  js  c++  java
  • HTML+CSS+JS

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="News.Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>5秒钟后自动跳转网页</title>
        <!--5秒钟后自动跳转网页-->
        <script type ="text/javascript" language ="javascript">
            //设置初始值
            var i = 5;
            //获取定时器的返回值,用来清除定时器
            var cleartime;
            //使用定时器,第一个参数,要执行定时器的函数,第二个参数,每个多长时间进行执行,1000MS = 1S
            cleartime = setInterval("fun()", 1000);
            //用来执行的函数
            function fun() {
                if (i == 0) {
                    //跳转网页
                    window.location.href = "Default.aspx";
                    //清除定时器,如未清除定时器,则会变为-1,-2,-3.......
                    clearInterval(cleartime);
                }
                //显示i的值
                document.getElementById("mes").innerHTML = i;
                //i - 1   
                i--;
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <p><span id ="mes">5</span></p>
        </form>
    </body>
    </html>
    
    
     
    

    全部复制,直接在页面(.aspx)保存,然后就可以运行。

  • 相关阅读:
    python:xlrd模块
    psql:转:会引起全表扫描的10种sql语句
    Linux相关
    面试题
    Siege Web服务器性能压力测试工具
    Nginx+uWSGI+Supervisor配置
    SQLAlchemy
    Virtualenv创建虚拟环境
    算法
    Mac常用快捷键
  • 原文地址:https://www.cnblogs.com/KTblog/p/4627689.html
Copyright © 2011-2022 走看看