JS에서 대상 웹사이트의 열기 응답 속도를 테스트하는 방법

亚连
풀어 주다: 2018-06-22 18:25:24
원래의
1696명이 탐색했습니다.

이 글에서는 대상 웹사이트의 오픈 응답 속도를 테스트하기 위해 JS를 사용하는 방법을 간략하게 설명합니다. 방법은 간단하고 명확하며 스크립트 소스 코드가 첨부되어 있습니다.

별거 없습니다. JS Things를 사용하여 간단한 디렉토리 웹 사이트 열기 속도를 작성했습니다. 이는 이 시스템에서 디렉토리 웹 사이트를 여는 속도일 뿐이며 실제로 이 속도로 사용할 수도 있다는 의미는 아닙니다. 로컬 네트워크 속도를 테스트하기 위해

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>

<body bgcolor="transparent" style="color:#FFFFFF;">
<style type="text/css">
input{font-size:12px;padding:0 5px;line-height:21px; font-family:tahoma;border:1px solid #ccc;height:21px;}                        </style>
<script language="javascript">
tim=1
setInterval("tim++",100)
b=1
var autourl = new Array();
autourl[1] = "www.qq.com";
autourl[2] = "www.jb51.net";
autourl[3] = "www.baidu.com";
autourl[4] = "www.sina.com";

function butt(){
document.write("<form name=autof style=&#39;padding:0px; margin:0px;&#39;>")
for (var i = 1; i < autourl.length; i++) document.write("<input type=text name=txt" + i + " size=25 style=&#39;color:#999;&#39; 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 onclick=&#39;window.location.reload()&#39; type=submit value=&#39;刷新&#39; style=&#39;margin-top:10px&#39;></form>")
}
butt()
function auto(url){
document.forms[0]["url"+b].value=url
if(tim>200)
{document.forms[0]["txt"+b].value="网址"+b+"链接超时"}
else
{ document.forms[0]["txt" + b].value = "网址" + b + ": 访问速度" + tim * 10 + "ms" }
b++
}
function run(){for(var i=1;i<autourl.length;i++)document.write("<img src="+autourl[i]+"/"+Math.random()+" width=1 height=1 onerror=auto(&#39;"+autourl[i]+"&#39;) style=&#39;display:none&#39;>")}
run()
</script>
</body>
</html>
로그인 후 복사

위 내용은 앞으로 모든 사람에게 도움이 되기를 바랍니다.

관련글 :

vue+vuex+axios+echarts에서 중국지도 구현하는 방법

입력방법으로 입력창이 막히는 문제 해결

입력창이 막히는 문제 해결 소프트 키보드가 js

의 입력 상자를 차단합니다.

Angular2에서 구성 요소 상호 작용을 구현하는 방법

JS+WCF에서 데이터 로딩을 모니터링하는 방법

위 내용은 JS에서 대상 웹사이트의 열기 응답 속도를 테스트하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!