2011-11-22 76 views
3

我的GWT的JavaScript應用程序通過打印程序打開一個新的瀏覽器窗口,其中我想打印的報告填充它,然後調用window.print報道:選項卡打開打印永久顯示「加載」圖標

native void openPrintWindow(String contents) /*-{ 
    var printWindow = window.open("", "PrintWin"); 
    if (printWindow && printWindow.top) { 
     printWindow.document.write("<html><head><title>Report Card Print Window</title></head><body>"); 
     printWindow.document.write(contents); 
     printWindow.document.write("</body></html>"); 
     printWindow.print(); 
    } else { 
     alert("The print feature works by opening a popup window, but our popup window was blocked by your browser. If you can disable the blocker temporarily, you'll be able to print here. Sorry!"); 
    } 
}-*/; 

這個效果很好,除了標題欄中的圖標永遠不會從其初始的旋轉加載圖標改變。我怎樣才能意識到它已經完成加載?

我認爲問題在於它實際上並沒有下載任何東西,所以它永遠不會「完成」。有什麼我可以打電話像document.finalize或任何東西?

回答