• 自动定时跳转


     1<script language="javascript" type="text/javascript">
     2var HongYiOvertime=58;
     3var HongYiStartDate=new Date(); 
     4var HongYiUpLineDate = HongYiStartDate.setMinutes(HongYiStartDate.getMinutes()+HongYiOvertime);
     5document.onmousedown=DoMouseDown;
     6//document.onmousemove=DoMouseMove;
     7//document.onmouseout=DoMouseOut;
     8document.onmouseup=DoMouseUp;
     9document.onkeydown=DoKeyDown;
    10function DoMouseDown()
    11{
    12   var crrutDate = new Date();
    13   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    14}

    15function DoMouseMove()
    16{
    17   var crrutDate = new Date();
    18   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    19}

    20function DoMouseOut()
    21{
    22   var crrutDate = new Date();
    23   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    24}

    25function DoMouseUp()
    26{
    27   var crrutDate = new Date();
    28   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    29}

    30function DoKeyDown()
    31{
    32   var crrutDate = new Date();
    33   HongYiUpLineDate = crrutDate.setMinutes(crrutDate.getMinutes()+HongYiOvertime);
    34}

    35function HongYiSetGoLogin()
    36{
    37//  var dateObj = new Date();
    38    var divObj = document.getElementById('div1_stratDate');
    39    var crrentDate=new Date(); 
    40
    41    if(((HongYiUpLineDate.valueOf()-crrentDate.valueOf())/60000)< 0)
    42    {
    43        divObj.innerText='当前时间:'+crrentDate.toLocaleString()+'['+(HongYiUpLineDate.valueOf()-crrentDate.valueOf())/1000+']秒后将跳转到登录页面';
    44        window.location='http://192.168.4.10/aqwebTest/'
    45    }

    46    divObj.innerText='当前时间:'+crrentDate.toLocaleString()+'['+(HongYiUpLineDate.valueOf()-crrentDate.valueOf())/1000+']秒后将跳转到登录页面';
    47   
    48}

    49window.setInterval('HongYiSetGoLogin()', 600);
    50        </script>
  • 相关阅读:
    Nginx 日志格式配置介绍
    Java Spring cron表达式使用详解
    Elasticsearch Query DSL
    Elasticsearch Search APIs
    网易2016研发工程师编程题:小易的升级之路
    2016奇虎360研发工程师内推笔试编程题:找镇长
    2016奇虎360研发工程师内推笔试编程题:找到字符串第一个只出现一次的字符
    lintcode: 最长无重复字符的子串
    lintcode :同构字符串
    lintcode : 跳跃游戏
  • 原文地址:https://www.cnblogs.com/wubiyu/p/807292.html
Copyright © 2020-2023  润新知