2016-12-29 102 views
0

我开发了一个Web应用程序。它包括2页,在JSP应用程序中添加UI直到加载页面

  • 的index.html
  • report.jsp

index.html中,增加了一个形式与用户输入的选择选项。在提交时,我们已将重定向到report.jsp以执行实际任务并呈现结果。结果已在report.jsp中发布。由于我们在report.jsp中添加了scriptlet,并且需要1-2分钟才能完成任务并显示结果。 我想添加一个进度条,直到report.jsp页面加载完成。你能不能有人提出一个实施这个想法?

+0

创建的onload功能页面创建进度条,我认为 – anon

+0

@Vysakh ..是..你必须调用体onaload功能或$(文件)。就绪(函数())},并可以创建tour pogress bar – Pooja

+0

或者您可以使用[PACE](http://github.hubspot.com/pace/docs/welcome/) – anon

回答

0

下面的java脚本代码将解决你的问题。添加一些样式表来定制它。

<section> 
<h2>Task Progress</h2> 
<p>Progress: <progress id="p" max=100><span>0</span>%</progress></p> 
<script> 
    var progressBar = document.getElementById('p'); 
    function updateProgress(newValue) { 
    progressBar.value = newValue; 
    progressBar.getElementsByTagName('span')[0].textContent = newValue; 
    } 
</script> 
</section> 
相关问题