我有一个显示进度条的Javascript函数?
<script type="text/javascript">
Counter = 10;
function DoCounter()
{
SlideParent = document.getElementById("SliderParent");
Slide = document.getElementById("Slider");
Slide.style.width = Counter + "%";
Slide.innerHTML = Counter + "%";
if(Counter <25)
{
SlideParent.style.borderColor = "green";
Slide.style.backgroundColor = "green";
}
else if(Counter >= 25 && Counter < 50)
{
SlideParent.style.borderColor = "blue";
Slide.style.backgroundColor = "blue";
}
else if(Counter >= 50 && Counter < 75)
{
SlideParent.style.borderColor = "orange";
Slide.style.backgroundColor = "orange";
}
else
{
SlideParent.style.borderColor = "red";
Slide.style.backgroundColor = "red";
}
if(Counter++ < 100)
{
setTimeout("DoCounter()",100);
}
}
</script>
这就是我在body标签里面的内容:
<div id="sync"><input type="submit" onclick="DoCounter();" /></div>
<div id="SliderParent" style="width:100%;">
<div id="Slider" style="width:0%; border-width:0px; background-color:red; color:white">
0%
</div>
</div>
当用户点击提交时,进度条将加载到同一页面中。我希望进度条加载到同一页面,但我删除所有内容。 document.write("Uploading..Please Wait")
这样做。我想删除所有内容,并添加Uploading ..Please Wait
下面的进度条。我怎么能这样做?