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>

  • 相关阅读:
    动态添加LInk的分析
    ASP.NET内置对象-网页转向的4中方法
    网页生命周期-动态添加控件
    网页生命周期-控件事件执行顺序
    网页生命周期-PageLoad事件
    HyperLink 控件
    ListBox控件
    OptionMenu选项菜单
    Menubutton按钮弹出菜单
    Menu-右键弹出菜单
  • 原文地址:https://www.cnblogs.com/lbjz/p/4165229.html
Copyright © 2011-2022 走看看