JavaScript模態窗口與非模態窗口


1. 非模態窗口刷新

在父頁面打開子頁面代碼爲:
window.open(url,' ','height= 500px, width= 760px');

子頁面刷新父頁面代碼爲:
window.opener.document.location.reload();

2.模態窗口刷新

父頁面打開子頁面:
window.showModalDialog(url,'window','dialogHeight:550px; dialogWidth:800px;  ');
             
子頁面刷新父頁面:
window.dialogArguments.location.reload();

window.showModalDialog和window.open都可以打開一個新的窗體,兩者的本質的區別僅僅在於用window.showModalDialog 打開的是一個模態窗口,而window.open打開的是一個非模態的窗口。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章