网页里的内容全部下载完毕后就会触发 onload 事件<html>
<head>
<title>一个显示正在加载的页面写法</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta content="F.R.Huang(meizz梅花雨)//www.meizz.com" name="author">
<script language=javascript>
document.write("<div id=loadingDiv><br> 页面正在加载,"+
"请等待<span id=loading></span></div>");
var s1 = setInterval("loading.innerText+='.'", 300);
var s2 = setInterval("loading.innerText = ''", 8000); function window.onload()
{
clearInterval(s1);
clearInterval(s2);
loadingDiv.removeNode(true);
bodyHidden.style.display = "";
}
</script>
</head><body>
<div id="bodyHidden" style="display: none">
<!-- 网页的具体代码 -->
</div>
</body></html>
<head>
<title>一个显示正在加载的页面写法</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta content="F.R.Huang(meizz梅花雨)//www.meizz.com" name="author">
<script language=javascript>
document.write("<div id=loadingDiv><br> 页面正在加载,"+
"请等待<span id=loading></span></div>");
var s1 = setInterval("loading.innerText+='.'", 300);
var s2 = setInterval("loading.innerText = ''", 8000); function window.onload()
{
clearInterval(s1);
clearInterval(s2);
loadingDiv.removeNode(true);
bodyHidden.style.display = "";
}
</script>
</head><body>
<div id="bodyHidden" style="display: none">
<!-- 网页的具体代码 -->
</div>
</body></html>
<!--
Dim Bar, Line, SP
Bar = 0
Line = "|"
SP = 10
Function Window_onLoad()
Bar = 95
SP = 10
End Function
Function Count()
If Bar < 100 Then
Bar = Bar + 1
Window.Status = "页面载入状态:" & Bar & "%" & " " & String(Bar, Line)
setTimeout "Count()", SP
Else
Window.Status = "页面载入状态:完成!"
Document.Body.Style.Display = ""
End If
End Function
Call Count()
-->
</script>