在查询页面中显示进度条,在数据load成功后隐去进度条 选择自 chensheng913 的 Blog
2005-04-14 08:16
579 查看
<script language="javascript">
function onSubmit() {
var waitingInfo = document.getElementById(getNetuiTagName("waitingInfo"));
waitingInfo.style.display = ""; //show the ProgressBar
progress_update(); //begin the progressbar
//waiting for several seconds,you would delete in your case
for(i=0;i<1000000;i++){
j=i+i;
}
location.href="progressbar.jsp"; //config your action page in here
}
// Build the netui_names table to map the tagId attributes
// to the real id written into the HTML
if (netui_names == null)
var netui_names = new Object();
netui_names.selectButton="portlet_15_1selectButton"
// method which will return a real id for a tagId
function getNetuiTagName(id) {
return netui_names[id];
}
// method which will return a real id for a tagId,
// the tag parameter will be used to find the scopeId for
// containers that may scope their ids
function getNetuiTagName(id, tag) {
var scopeId = getScopeId(tag);
if (scopeId == "")
return netui_names[id];
else
return netui_names[scopeId + "__" + id];
}
// method which get a tag will find any scopeId that,
// was inserted by the containers
function getScopeId(tag) {
if (tag == null)
return "";
if (tag.getAttribute) {
if (tag.getAttribute('scopeId') != null)
return tag.getAttribute('scopeId');
}
if (tag.scopeId != null)
return tag.scopeId;
return getScopeId(tag.parentNode);
}
// Build the netui_names table to map the tagId attributes
// to the real id written into the HTML
if (netui_names == null)
var netui_names = new Object();
netui_names.waitingInfo="waitingInfo"
var progressEnd = 15; // set to number of progress <span>'s.
var progressColor = 'green'; // set to progress bar color
var progressInterval = 200; // set to time between updates (milli-seconds)
var progressAt = progressEnd;
var progressTimer;
function progress_clear() {
for (var i = 1; i <= progressEnd; i++)
document.getElementById('progress'+i).style.backgroundColor = 'transparent';
progressAt = 0;
}
function progress_update() {
progressAt++;
if (progressAt > progressEnd) progress_clear();
else document.getElementById('progress'+progressAt).style.backgroundColor = progressColor;
progressTimer = setTimeout('progress_update()',progressInterval);
}
function progress_stop() {
clearTimeout(progressTimer);
progress_clear();
}
</script>
<span id="waitingInfo" style="display:none">
<table align="center"><tr><td>
正在处理数据, 请稍候......
<div style="font-size:2pt;padding:2px;border:solid black 1px">
<span id="progress1"> </span>
<span id="progress2"> </span>
<span id="progress3"> </span>
<span id="progress4"> </span>
<span id="progress5"> </span>
<span id="progress6"> </span>
<span id="progress7"> </span>
<span id="progress8"> </span>
<span id="progress9"> </span>
<span id="progress10"> </span>
<span id="progress11"> </span>
<span id="progress12"> </span>
<span id="progress13"> </span>
<span id="progress14"> </span>
<span id="progress15"> </span>
</div>
</td></tr></table>
</span>
<center>
点击按钮试试:
<input name="button" type="button" value="查询" onClick="javascript: return onSubmit();">
</center>
function onSubmit() {
var waitingInfo = document.getElementById(getNetuiTagName("waitingInfo"));
waitingInfo.style.display = ""; //show the ProgressBar
progress_update(); //begin the progressbar
//waiting for several seconds,you would delete in your case
for(i=0;i<1000000;i++){
j=i+i;
}
location.href="progressbar.jsp"; //config your action page in here
}
// Build the netui_names table to map the tagId attributes
// to the real id written into the HTML
if (netui_names == null)
var netui_names = new Object();
netui_names.selectButton="portlet_15_1selectButton"
// method which will return a real id for a tagId
function getNetuiTagName(id) {
return netui_names[id];
}
// method which will return a real id for a tagId,
// the tag parameter will be used to find the scopeId for
// containers that may scope their ids
function getNetuiTagName(id, tag) {
var scopeId = getScopeId(tag);
if (scopeId == "")
return netui_names[id];
else
return netui_names[scopeId + "__" + id];
}
// method which get a tag will find any scopeId that,
// was inserted by the containers
function getScopeId(tag) {
if (tag == null)
return "";
if (tag.getAttribute) {
if (tag.getAttribute('scopeId') != null)
return tag.getAttribute('scopeId');
}
if (tag.scopeId != null)
return tag.scopeId;
return getScopeId(tag.parentNode);
}
// Build the netui_names table to map the tagId attributes
// to the real id written into the HTML
if (netui_names == null)
var netui_names = new Object();
netui_names.waitingInfo="waitingInfo"
var progressEnd = 15; // set to number of progress <span>'s.
var progressColor = 'green'; // set to progress bar color
var progressInterval = 200; // set to time between updates (milli-seconds)
var progressAt = progressEnd;
var progressTimer;
function progress_clear() {
for (var i = 1; i <= progressEnd; i++)
document.getElementById('progress'+i).style.backgroundColor = 'transparent';
progressAt = 0;
}
function progress_update() {
progressAt++;
if (progressAt > progressEnd) progress_clear();
else document.getElementById('progress'+progressAt).style.backgroundColor = progressColor;
progressTimer = setTimeout('progress_update()',progressInterval);
}
function progress_stop() {
clearTimeout(progressTimer);
progress_clear();
}
</script>
<span id="waitingInfo" style="display:none">
<table align="center"><tr><td>
正在处理数据, 请稍候......
<div style="font-size:2pt;padding:2px;border:solid black 1px">
<span id="progress1"> </span>
<span id="progress2"> </span>
<span id="progress3"> </span>
<span id="progress4"> </span>
<span id="progress5"> </span>
<span id="progress6"> </span>
<span id="progress7"> </span>
<span id="progress8"> </span>
<span id="progress9"> </span>
<span id="progress10"> </span>
<span id="progress11"> </span>
<span id="progress12"> </span>
<span id="progress13"> </span>
<span id="progress14"> </span>
<span id="progress15"> </span>
</div>
</td></tr></table>
</span>
<center>
点击按钮试试:
<input name="button" type="button" value="查询" onClick="javascript: return onSubmit();">
</center>
相关文章推荐
- 在查询页面中显示进度条,在数据load成功后隐去进度条
- ###(很难找的页面错误)查询操作不需要 返回 操作成功后失败。【方法不能同时执行两个response返回两次数据。导致页面显示数据失败】
- 在 Asp.Net Web 应用程序中长时间装载页面时显示进度条 选择自 chenweionline 的 Blog
- 点击事件,选择按钮,点击从前端传到后台,查询数据,并返回前段,显示出来。---tp5
- JQuery EasyUI的datagrid,查询后数据返回来了,但是页面不显示数据,也没有表格,只要行数
- 在action中,数据添加、修改成功后,向页面显示提示信息,包括可能出现的问题。
- Web页面实现后台数据处理进度与剩余时间的显示
- hive导入数据成功,但是查询显示NULL
- C# WPF 进度条,根据读取数据显示进度条进度,根据Excel文件读取数据,进度条样式
- C#主要用于查询sql的web项目:gridview在页面上显示数据量大时跳转十分缓慢的解决方案
- WebView 加载数据时显示进度条,加载完后再把进度条取消并显示内容
- wpf 窗体Load事件加载数据导致白屏 先展示加载进度BackgroundWorker(直至加载完成)显示
- 如何让ajax技术显示数据的jsp页面第一次加载就加载默认查询数据
- 在Action中查询出SQL SERVER表的数据,返回一个list。怎么在JSP页面中使用Struts标签,显示出表中的内容?(转)
- Ecshop中是如何将查询到的数据传送到页面并显示的呢?
- 根据用户查询选择动态显示表的数据列
- EasyNVR流媒体服务器网页兼容调试:ie浏览器下的接口调用成功但页面无法显示实时的数据
- 使用BackGroundWork处理大批量数据并用进度条显示进度
- [置顶] Eclipse+JSP使用自定义标签库查询出MySQL表中的数据显示在页面
- 使用BackGroundWork处理大批量数据并用进度条显示进度 (转)