AJAX技术实现网页无刷新进度条显示(2)
<title>无刷新页面进度条测试</title>
<STYLE TYPE="text/css">
<!--
BODY {OVERFLOW:scroll;OVERFLOW-X:hidden}
.DEK {POSITION:absolute;VISIBILITY:hidden;Z-INDEX:200;}
//-->
</STYLE>
<script type="text/javascript">
var xmlHttp;
var pbid;//进度条ID
function createXMLHttpRequest(){
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function checkDiv() {
var progress_bar = document.getElementById("progressBar");
if (progress_bar.style.visibility != "visible") {
progress_bar.style.visibility = "visible";
}else
{
progress_bar.style.visibility = "hidden";
}
}
function go() {
createXMLHttpRequest();
checkDiv();
var url = "../servlet/ProgressBarServlet?task=create&impcls=blogcn.pb.imp.TestPB";//其中blogcn.pb.imp.TestPB是复杂事务的实现类
var button = document.getElementById("go");
button.disabled = true;
xmlHttp.open("GET", url, true);
xmlHttp.setRequestHeader("Content-T
相关新闻>>
- 发表评论
-
- 最新评论 更多>>