DIV CSS 佈局教程網

10.2 開啟與關閉視窗
編輯:JavaScript基礎知識     

window.open 與 close

window.open() 可開啟新視窗,close() 可關閉視窗。

var win = window.open("https://example.com", "", "width=300,height=200");
win.close();

若 URL 留空,可開啟空白視窗再用 document.write() 輸出內容。關閉目前視窗可使用 window.close()。

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