此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。

View in English Always switch to English

Window:print() 方法

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2023年6月.

開啟列印對話框以列印目前的文件。

若呼叫此函式時文件仍在載入中,則文件將在開啟列印對話框前完成載入。

當列印對話框開啟時,此方法將會阻塞。

語法

js
print()

參數

無。

回傳值

無(undefined)。

規範

Specification
HTML
# printing

瀏覽器相容性

參見