2016-12-29 150 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> 
相關問題