DIV CSS 佈局教程網

JS 彈出對話框函數:window.open 與 showModalDialog
編輯:關於JavaScript     

window.open

window.open 可開啟新視窗或新分頁,常用於彈出視窗。可設定寬高、工具列、網址列、捲軸等。

window.open(url, "_blank", "height=200,width=400,toolbar=no,menubar=no");

showModalDialog

showModalDialog 可開啟強制互動的對話框,在舊版 IE 常見。可設定 dialogHeight、dialogWidth、center、status、scroll 等。

window.showModalDialog(url, null, "dialogHeight:300px;dialogWidth:850px;center:yes;");

注意

現代瀏覽器多限制非使用者觸發的彈出視窗,showModalDialog 也已不建議使用。新專案可考慮 dialog 元素或自訂遮罩層。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved