Loading……显示页面打开时间

发布时间:2008-08-01 00:00:00 阅读次数:

你花了 2.8 秒打开这个页面

这个当然是假的了,一个随机数而已。但用来唬唬人还是可以的 :)

源文件如下:

<body id=body>

<div id=ld> <center> <h1>Loading...</h1> <table width=50%><tr><td align=left> <table id=lpc bgcolor=blue><tr><td> </td></tr></table> </td></tr></table> </center> </div>

<div style=display:none; id=page>你花了<q id=q></q> 秒打开这个页面
* 在这里填入你网页的正文
</div>

<script language=JavaScript> <!-- ini = new Date().getTime(); var pc = 0; load(); function load() { pc += 4; lpc.style.width = pc + "%"; time = setTimeout("load()",100); if (pc > 100) { clearTimeout(time); loaded() } } function loaded() { fim = new Date().getTime(); dif = fim - ini; ld.style.display = 'none'; body.style.backgroundColor = 'silver'; q.innerHTML = dif/1000; page.style.display = ''; } function Show() { if (txt.style.display == "none") { txt.style.display = "" } else { txt.style.display = "none" } } // event.onAnyDoubt = "../js.htm"; --></script>

</body>