<scriptlanguage="javascript">
functiononSubmit(){
varwaitingInfo=document.getElementById(getNetuiTagName("waitingInfo"));
waitingInfo.style.display="";//showtheProgressBar
progress_update();//begintheprogressbar
//waitingforseveralseconds,youwoulddeleteinyourcase
for(i=0;i<1000000;i++){
j=i+i;
}
location.href="progressbar.jsp";//configyouractionpageinhere
}
//Buildthenetui_namestabletomapthetagIdattributes
//totherealidwrittenintotheHTML
if(netui_names==null)
varnetui_names=newObject();
netui_names.selectButton="portlet_15_1selectButton"
//methodwhichwillreturnarealidforatagId
functiongetNetuiTagName(id){
returnnetui_names[id];
}
//methodwhichwillreturnarealidforatagId,
//thetagparameterwillbeusedtofindthescopeIdfor
//containersthatmayscopetheirids
functiongetNetuiTagName(id,tag){
varscopeId=getScopeId(tag);
if(scopeId=="")
returnnetui_names[id];
else
returnnetui_names[scopeId+"__"+id];
}
//methodwhichgetatagwillfindanyscopeIdthat,
//wasinsertedbythecontainers
functiongetScopeId(tag){
if(tag==null)
return"";
if(tag.getAttribute){
if(tag.getAttribute('scopeId')!=null)
returntag.getAttribute('scopeId');
}
if(tag.scopeId!=null)
returntag.scopeId;
returngetScopeId(tag.parentNode);
}
//Buildthenetui_namestabletomapthetagIdattributes
//totherealidwrittenintotheHTML
if(netui_names==null)
varnetui_names=newObject();
netui_names.waitingInfo="waitingInfo"
varprogressEnd=15;//settonumberofprogress<span>'s.
varprogressColor='green';//settoprogressbarcolor
varprogressInterval=200;//settotimebetweenupdates(milli-seconds)
varprogressAt=progressEnd;
varprogressTimer;
functionprogress_clear(){
for(vari=1;i<=progressEnd;i++)
document.getElementById('progress'+i).style.backgroundColor='transparent';
progressAt=0;
}
functionprogress_update(){
progressAt++;
if(progressAt>progressEnd)progress_clear();
elsedocument.getElementById('progress'+progressAt).style.backgroundColor=progressColor;
progressTimer=setTimeout('progress_update()',progressInterval);
}
functionprogress_stop(){
clearTimeout(progressTimer);
progress_clear();
}
</script>
<spanid="waitingInfo"style="display:none">
<tablealign="center"><tr><td>
正在处理数据,请稍候......
<divstyle="font-size:2pt;padding:2px;border:solidblack1px">
<spanid="progress1"></span>
<spanid="progress2"></span>
<spanid="progress3"></span>
<spanid="progress4"></span>
<spanid="progress5"></span>
<spanid="progress6"></span>
<spanid="progress7"></span>
<spanid="progress8"></span>
<spanid="progress9"></span>
<spanid="progress10"></span>
<spanid="progress11"></span>
<spanid="progress12"></span>
<spanid="progress13"></span>
<spanid="progress14"></span>
<spanid="progress15"></span>
</div>
</td></tr></table>
</span>
<center>
点击按钮试试:
<inputname="button"type="button"value="查询"onClick="javascript:returnonSubmit();">
</center>