当然,在请求时无法统计HTTP头部的长度,所以当请求数据包长度在最大传输单元临界点时,额外的HTTP头可以导致IP分组,因此存在一定的误差.(2009/6/21) 在线演示:http://demo.jb51.net/js/2011/ping/核心代码: 复制代码 代码如下: HTTP Ping <BR>html <BR>{ <BR>height: 100%; <BR>overflow: hidden; <BR>} <BR>body <BR>{ <BR>background: #000; <BR>color: #C0C0C0; <BR>font-weight: bold; <BR>font-size: 14px; <BR>font-family: Lucida Console; <BR>height: 100%; <BR>margin: 0 0 0 5px; <BR>} <BR>#divContent <BR>{ <BR>height: 90%; <BR>overflow: auto; <BR>} <BR>#txtTimeout <BR>{ <BR>width: 40px; <BR>} <BR>button <BR>{ <BR>margin-left: 10px; <BR>} <BR> URL: Timeout: <BR>var intStartTime; <BR>var objIMG = new Image(); <BR>objIMG.onload = <BR>objIMG.onerror = <BR>function() <BR>{ <BR>/* <BR>*