This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11725|Reply: 0

[JavaScript] Test website responsiveness script with js

[Copy link]
Posted on 12/6/2015 8:17:04 PM | | | |

In terms of response speed:

Tencent ranked first,
Code Agriculture Network ranked second


It seems that our website is still responsive

There is a feeling of wood opening in seconds?

Attached is the js script:


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

  7. <body bgcolor="transparent" style="color:#FFFFFF;">
  8.         <style type="text/css">
  9. input{font-size:12px;padding:0 5px;line-height:21px; font-family:tahoma;border:1px solid #ccc;height:21px;}                                                </style>
  10. <scrip{过滤}t language="javascrip{过滤}t">
  11. tim=1
  12. setInterval("tim++",100)
  13. b=1
  14. var autourl = new Array();
  15. autourl[1] = "www.qq.com";
  16. autourl[2] = "www.itsvse.net";
  17. autourl[3] = "www.baidu.com";
  18. autourl[4] = "www.sina.com";

  19. function butt(){
  20. document.write("<form name=autof style='padding:0px; margin:0px;'>")
  21. for (var i = 1; i < autourl.length; i++) document.write("<input type=text name=txt" + i + " size=25 style='color:#999;' value=测试中…> =》<input type=text name=url" + i + " size=40> =》<input type=button value=GO onclick=window.open(this.form.url" + i + ".value)><br>")
  22. document.write("<input onclick='window.locatio{过滤}n.reload()' type=submit value='刷新' style='margin-top:10px'></form>")
  23. }
  24. butt()
  25. function auto(url){
  26. document.forms[0]["url"+b].value=url
  27. if(tim>200)
  28. {document.forms[0]["txt"+b].value="网址"+b+"链接超时"}
  29. else
  30. { document.forms[0]["txt" + b].value = "网址" + b + ": 访问速度" + tim * 10 + "ms" }
  31. b++
  32. }
  33. function run(){for(var i=1;i<autourl.length;i++)document.write("<img src="+autourl[i]+"/"+Math.random()+" width=1 height=1 onerror=auto('"+autourl[i]+"') style='display:none'>")}
  34. run()
  35. </scrip{过滤}t>
  36. </body>
  37. </html>
Copy code
新建文本文档 (2).html (1.62 KB, Number of downloads: 5)





Previous:Junior programmer mock exam system, write yourself and share it with you
Next:Hide PHP version and PHP basic security settings
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com