• 网页测速,以及定时刷新


    <%@ 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>

  • 相关阅读:
    关于心累的思考
    关于组件化开发的思考
    分页组建感想
    工作日记
    unload没有用
    今天很不开心
    select option
    reduce()用法
    $.each()用法
    MFC创建对话框组件对应变量并进行设置值(VS2010)
  • 原文地址:https://www.cnblogs.com/lbjz/p/4165229.html
Copyright © 2020-2023  润新知