注册 登录
编程论坛 ASP技术论坛

[求助] 怎样做动态显示页面执行进度的文字

robinbest 发布于 2007-10-30 21:13, 1454 次点击
问题很简单,如下图:这个东西怎么做出来的?
只有本站会员才能查看附件,请 登录


12 回复
#2
multiple19022007-10-30 21:32
代码是在客户端执行的。自己看源代码。
#3
robinbest2007-10-31 10:56
以下是引用multiple1902在2007-10-30 21:32:01的发言:
代码是在客户端执行的。自己看源代码。

源代码在哪?

#4
永夜的极光2007-10-31 11:22
以下是引用robinbest在2007-10-31 10:56:18的发言:

源代码在哪?

点击菜单里面的查看->查看源文件

#5
yms1232007-10-31 11:42

那个加载其实是一个假象,并不是真正的加载。
里面在用
window.setTimeout("self.location='[网页的URL地址]';",1000);
这样的javascript脚本延时跳转而以。

#6
robinbest2007-10-31 13:57
以下是引用yms123在2007-10-31 11:42:48的发言:

那个加载其实是一个假象,并不是真正的加载。
里面在用
window.setTimeout("self.location='[网页的URL地址]';",1000);
这样的javascript脚本延时跳转而以。

不会吧!
那真的怎么做呢?

#7
multiple19022007-10-31 15:03
以下是引用yms123在2007-10-31 11:42:48的发言:

那个加载其实是一个假象,并不是真正的加载。
里面在用
window.setTimeout("self.location='[网页的URL地址]';",1000);
这样的javascript脚本延时跳转而以。

bccn的那个提示貌似是真的.
思路是先在网页上放一个div,提示正在加载,然后后面的内容都放在另外的div里面,默认隐藏.等到大部分代码下载好之后执行新的代码(新的代码放在大部分代码后面,自然就后执行了),内容是显示隐藏的div,隐藏那个提示div.

#8
lq73506842007-10-31 15:58
楼上的是谁啊?看了你回的很多帖子,好厉害啊。
#9
提灯寻影2007-10-31 18:38

他是版主,当然很多帖子了

#10
multiple19022007-10-31 21:04
以下是引用提灯寻影在2007-10-31 18:38:25的发言:

是版主,当然很多帖子了

#11
madpbpl2007-10-31 21:55

一个进度条的例子
[CODE]<!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=gb2312" />
<title>无标题文档</title>
<style>
<!--
#bar, #barbackground{
position:absolute;
left:0;
top:0;
background-color:blue;
}
#barbackground{
background-color:black;
}
-->
</style>
<script language="JavaScript1.2">
/*
Dynamic Progress Bar- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/
//1) Set the duration for the progress bar to complete loading (in seconds)
var duration=5
//2) Set post action to carry out inside function below:
function postaction(){
//Example action could be to navigate to a URL, like following:
//window.location="http://www.dynamicdrive.com"
}

///Done Editing/////////////
var clipright=0
var widthIE=0
var widthNS=0
function initializebar(){
if (document.all){
baranchor.style.visibility="visible"
widthIE=bar.style.pixelWidth
startIE=setInterval("increaseIE()",50)
}
if (document.layers){
widthNS=document.baranchorNS.document.barbackgroundNS.clip.width
document.baranchorNS.document.barNS.clip.right=0
document.baranchorNS.visibility="show"
startNS=setInterval("increaseNS()",50)
}
}
function increaseIE(){
bar.style.clip="rect(0 "+clipright+" auto 0)"
window.status="Loading..."
if (clipright<widthIE)
clipright=clipright+(widthIE/(duration*20))
else{
window.status=''
clearInterval(startIE)
postaction()
}
}
function increaseNS(){
if (clipright<202){
window.status="Loading..."
document.baranchorNS.document.barNS.clip.right=clipright
clipright=clipright+(widthNS/(duration*20))
}
else{
window.status=''
clearInterval(startNS)
postaction()
}
}

window.onload=initializebar
</script>
</head>
<body>
<script language="JavaScript1.2">
if (document.all){
document.write('<div id="baranchor" style="position:relative;width:200px;height:20px;visibility:hidden;">')
document.write('<div id="barbackground" style="width:200px;height:20px;z-index:9"></div>')
document.write('<div id="bar" style="width:200px;height:20px;z-index:10"></div>')
document.write('</div>')
}
</script>
<ilayer name="baranchorNS" visibility="hide" width=200 height=20>
<layer name="barbackgroundNS" bgcolor=black width=200 height=20 z-index=10 left=0 top=0></layer>
<layer name="barNS" bgcolor=blue width=200 height=20 z-index=11 left=0 top=0></layer>
</ilayer>
</body>
</html>[/CODE]

#12
robinbest2007-10-31 22:20

各位不要讨论那么深!

我只想要个简单的功能:
我要筛选出一个记录很多的表(可能会有10000条以上的记录),
而且由于网络原因,如果常规处理的话网页打开会有3秒左右的无反应,
我只是想在屏幕上显示一个信息,让浏览者知道不是死了。


Thanks

[此贴子已经被作者于2007-11-1 17:53:25编辑过]

#13
tianyu1232007-11-01 19:14
<div style="display:block" id=d1>
正在加载信息......
</div>
<div style="display:none" id=d2>
<script language=javascript>
for(i=1;i<=10000;i++)
{
document.write(i+"<br>");
}
document.getElementById("d1").style.display="none";
document.getElementById("d2").style.display="block";
</script>
</div>
1