Window.print()
Baseline 2023
Newly available
Since June 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
io error: No such file or directory (os error 2) (/home/runner/work/yari/yari/mdn/translated-content/files/zh-tw/web/api/window/index.md)
摘要
打開列印視窗來列印當前的文件。
語法
window.print()
注釋
Starting with Chrome V46.0 this method is blocked inside an <iframe>
unless its sandbox attribute has the value allow-modals
.
規範
Specification |
---|
HTML Standard # printing |