Window:print() 方法
Baseline 2023Newly available
Since June 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
打开打印对话框,以打印当前文档。
如果调用此函数时文档仍在加载中,那么文档将在打开打印对话框之前完成加载。
当打印对话框打开时,此方法将阻塞。
语法
js
print()
参数
无
返回值
无(undefined
)。
规范
Specification |
---|
HTML # printing |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
print |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
参见
- 打印
beforeprint
事件afterprint
事件