• 自定义app_offline.htm,让网站升级提示更专业


    用 VS2005 发布新网站时,VS会自动上传个 app_offline.htm 到网站上。

    这时,所有的网站连接都成为如下图所示:
    r_offline.jpg

    提示信息对开发者来说,有点用处。但是,对于正在访问中用户来说,实在是蹩脚。

    那么,如何让升级的时候,给访问用户一个良好的信息提示呢?

    答案很简单,修改VS2005里的这个文件 app_offline.htm
    路径: C:\Documents and Settings\Silver\Application Data\Microsoft\VisualStudio\8.0
    (路径与VS2005安装目录有关)

    以下发个修改示例:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>网站升级中</title>
      <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    </head>
    <style>
    div {
        background-color:#ffffcc;
        padding-top:10px;
        padding-bottom:10px;
        padding-left:10px;
        padding-right:10px;   
        border-style:solid;
        border-color:Black;
        border-1px;
    }
      #WaitTimeSpan { color: blue; font-family: verdana; font-weight: bold; }
      body{ font-size: 42pt; background-color: silver; text-align:center; }
     
    </style>
    <body>
      <div> 
    <p>网站正在升级中……</p>
    <p>请稍等 <span id="WaitTimeSpan">61</span> 秒……</p>
    <p>敬请谅解!</p>
      <p>Web Site Update in progress. </p>
      <p>Please wait for a moment.</p>
      </div>
    <script type="text/javascript">
    function Goto()
    {
        var waitTimeSpan = document.getElementById("WaitTimeSpan");
        var seconds = parseInt(waitTimeSpan.innerText);
       
        if (seconds == 0)
        {
            location.href = location.href;
            return;
        }
        else
        {
            seconds--;
            waitTimeSpan.innerText = seconds.toString();
        }   
        setTimeout("Goto()", 1000);
    }
    Goto();
    </script>
    </html>


    参看示例:
    r_WebSiteUpdate.jpg
  • 相关阅读:
    百度编辑器 Ueditor使用记录
    JS实现继承的几种方式
    IOS 浏览器上设置overflow: auto 不可滚动
    throw new Error('Cyclic dependency' + nodeRep)
    如何理解springaop
    SQL连接的分类
    Eclipse创建Maven-Web项目及解决 jre版本和web.xml版本问题
    SQL的几种连接:内连接、左联接、右连接、全连接、交叉连接
    Centos7下面安装eclipse
    Centos7 下编译 Openjdk8
  • 原文地址:https://www.cnblogs.com/sasbya/p/789594.html
Copyright © 2020-2023  润新知