我想通過GWT實現類似下面的內容(下面的代碼是javascript)。訪問最新在gwt中打開的窗口
function openWin() {
var myWindow=window.open('','','width='+screen.width+',height='+screen.height+',left='+screen.width);
myWindow.document.write("<p>This is 'myWindow'</p>");
myWindow.document.write("<span id='span'></span>");
myWindow.document.close();
myWindow.document.getElementById('span').innerText = 'something';
}
我怎樣才能在GWT實現這一點,當我嘗試這段JavaScript代碼本身,我的GWT項目中,left='+screen.width
不似乎FF是工作和myWindow.document.getElementById('span').innerText = 'something';
並不似乎是在Chrome瀏覽器中工作。在javascript中對它們進行糾正對我來說也是很好的,只要它適用於FF和Chrome即可。
關於使用gwt的PopupPanel,那也不能幫助我。據我所知,PopupPanel不能被刪除頁面。在我的場景中,新窗口應該在我的secondory顯示中打開(可以使用當前的js代碼實現,使用代碼'width='+screen.width+',height='+screen.height+',left='+screen.width
。(如果我錯了,請指導我瞭解PopupPanel的這種屬性
好的,我可以用FF解決這個問題,但沒有使用這個javascript代碼,我用'innerHTML'代替了'innerText',但我仍然在尋找GWT本身的解決方案。 –