如果您对使用JS库不太反感,那么您可以考虑使用JQuerys UI库。
http://jqueryui.com/progressbar/
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Progressbar - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$("#progressbar").progressbar({
value: 50
});
});
</script>
</head>
<body>
<div id="progressbar"></div>
</body>
</html>
如果你将它与JQuery的Ajax请求相结合,那么你应该能够达到你所追求的:http://api.jquery.com/jquery.ajax/
然后,您可以定期调用服务器端页面获得一个值来填充进度条。
让我知道,如果这是直接的方向,我可以阐述,如果需要的话。