blob: 4e2a543cf508f25ecc7e456228903b98dd470e1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
---
title: Window.print()
slug: Web/API/Window/print
translation_of: Web/API/Window/print
---
<p>{{ ApiRef() }}</p>
<h2 id="Summary" name="Summary">摘要</h2>
<p>打開列印視窗來列印當前的文件。</p>
<h2 id="Syntax" name="Syntax">語法</h2>
<pre class="eval">window.print()
</pre>
<h2 id="Specification" name="Specification">注釋</h2>
<p>Starting with Chrome {{CompatChrome(46.0)}} this method is blocked inside an {{htmlelement("iframe")}} unless its sandbox attribute has the value <code>allow-modals</code>.</p>
<h2 id="Specification" name="Specification">規範</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG', 'timers-and-user-prompts.html#printing', 'print()')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="參見">參見</h2>
<ul>
<li><a href="/en/Printing" title="en/Printing">Printing</a></li>
<li>{{ domxref("window.onbeforeprint") }}</li>
<li>{{ domxref("window.onafterprint") }}</li>
</ul>
<p>{{ languages( { "ja": "ja/DOM/window.print", "it": "it/DOM/window.print" , "zh-cn": "zh-cn/DOM/window.print" } ) }}</p>
|