zoukankan      html  css  js  c++  java
  • 网页测速,以及定时刷新

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>


    <title>网页测速,以及定时刷新</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <script src="jquery-1.9.1.js" /></script>
    <script type="text/javascript">
    //定时两秒刷新一次
    setInterval('sub()',2000);
    function sub(){
    $("#sub").click();
    }
    </script>
    </head>
    <body>
    <a href=""></a>
    测试网站连接速度:
    <script language="javascript">
    tim=1
    setInterval("tim++",100)
    b=1
    var autourl=new Array()
    autourl[1]="www.baidu.com"
    autourl[2]="www.sina.com"
    autourl[3]="www.qq.com"
    function butt(){
    document.write("<form name=autof>")
    for(var i=1;i<autourl.length;i++)document.write("<input type=text name=txt"+i+" size=10 value=测试中……> =》<input type=text name=url"+i+" size=40> =》<input type=button value=GO onclick=window.open(this.form.url"+i+".value)><br>")
    document.write("<input type=submit id='sub' value=刷新></form>")
    }
    butt()
    function auto(url){
    document.forms[0]["url"+b].value=url
    if(tim>200)
    {document.forms[0]["txt"+b].value="链接超时"}
    else
    {document.forms[0]["txt"+b].value="时间"+tim/10+"秒"}
    b++
    }
    function run(){for(var i=1;i<autourl.length;i++)document.write("<img src=http://"+autourl[i]+"/"+Math.random()+" width=1 height=1 onerror=auto('http://"+autourl[i]+"')>")}
    run()
    </script>
    </body>
    </html>

  • 相关阅读:
    读完此文让你了解各个queue的原理
    借汇编之力窥探String背后的数据结构奥秘
    汇编高手带你玩转字符串,快上车!
    语雀调研
    产品技能一:抽象能力
    我所认知的敏捷开发
    产品经理需要的技能,我有吗?
    孙正义采访:接下来的30年,一切将被重新定义
    5G小白鼠
    goto语句为啥不受待见
  • 原文地址:https://www.cnblogs.com/lbjz/p/4165229.html
Copyright © 2011-2022 走看看