jsp进度条(急)
我在jsp上想调用一个存储过程,但需要时间太长,想用个进度条提示用户,那位高手有jsp进度条的源代码啊,小弟先谢过啦
------解决方案--------------------
楼主大致 计算 一下时间用 技术显示啊
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>counter</title>
<script language="javascript" type="text/JavaScript">
function Counter(nMax,nInterval)
{
this.maxTime=nMax;
this.interval=nInterval;
this.objId="timer";
this.obj=null;
this.num=this.maxTime;
this.timer=null;
this.start=function()
{
this.obj=document.getElementById(this.objId);
if(this.num>0) setTimeout(this.run,this.interval*1000);
};
this.run=function()
{
if(myCounter.num>0)
{
myCounter.num--;
myCounter.obj.innerHTML=myCounter.num;
myCounter.timer=setTimeout(myCounter.run,myCounter.interval*1000);
}
else if(myCounter.num==0)
else clearTimeout(myCounter.timer);
};
this.show=function()
{
document.write("<span id="+this.objId+">"+this.num+"</span>");
this.obj=document.getElementById(this.objId);
//alert(this.obj.innerHTML);
}
}
</script>
</head>
<body onLoad="myCounter.start();">
<script language="JavaScript" type="text/JavaScript">
var myCounter=new Counter(5,1);
</script>
<center>
<br><br>
正在执行存储过程<br>
<p>现在剩下
<script language="JavaScript" type="text/JavaScript">
myCounter.show();
</script>
秒钟!</p></center>
</body>
</html>
------解决方案--------------------<head>
<title>LOADING</title>
<script type=text/javascript>
<!--
//
//
var ie5 = (document.all && document.getElementsByTagName);
var step = 0;
function setSB(v, el, inforEl, message) {
if (ie5 || document.readyState == "complete") {
filterEl = el.children[0];
valueEl = el.children[1];
if (filterEl.style.pixelWidth > 0) {
var filterBackup = filterEl.style.filter;
filterEl.style.filter = "";
filterEl.style.filter = filterBackup;
}
filterEl.style.width = v + "%";
valueEl.innerText = v + "%";
inforEl.innerText = message;
}
}
function setSBByStep(v, el, inforEl, message) {
if (ie5 || document.readyState == "complete") {
step = step + v;
filterEl = el.children[0];
valueEl = el.children[1];
if (filterEl.style.pixelWidth > 0) {
var filterBackup = filterEl.style.filter;
filterEl.style.filter = "";
filterEl.style.filter = filterBackup;
}
filterEl.style.width = step + "%";
valueEl.innerText = step + "%";
inforEl.innerText = message;
}
}
function fakeProgress(v, el) {
if (v >= 101) {
location.href = "www.ldxk.com";
} else {
setSB(v, el, infor, " \u52a0\u8f7d\u4e2d\u2026\u2026");
window.setTimeout("fakeProgress(" + (v + 1) + ", document.all['" + el.id + "'])", 20);
}
}
//-->
</script>
</head>
<body onload="fakeProgress(0,sb)">
<table width="699">
<td width="691" height="300">
</table>
<DIV align=center>
<DIV id=sb style="BORDER-RIGHT: #f