aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/document/documenturi/index.html
blob: 7451aefcfc5e44252a197c842d919289887e1ecf (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
title: Document.documentURI
slug: Web/API/Document/documentURI
tags:
- API
- DOM
- Document
- Property
- Read-only
- Reference
  - Web
  - プロパティ
translation_of: Web/API/Document/documentURI
---
<div>{{ApiRef("DOM")}}</div>

<p>{{domxref("Document")}} インターフェイスの <code><strong>documentURI</strong></code> プロパティは、文書の位置を文字列で返します。</p>

<h2 id="Syntax">構文</h2>

<pre class="brush: js">const <em>uri</em> = <em>document</em>.documentURI
</pre>

<h2 id="Example"></h2>

<h3 id="JavaScript">JavaScript</h3>

<pre
  class="brush: js">document.getElementById("url").textContent = document.documentURI;</pre>

<h3 id="HTML">HTML</h3>

<pre class="brush: html">&lt;p id="urlText"&gt;
  URL:&lt;br/&gt;
  &lt;span id="url"&gt;URL goes here&lt;/span&gt;
&lt;/p&gt;</pre>

<h3 id="Result">結果</h3>

<p>{{EmbedLiveSample("Example", "100%", 100)}}</p>

<h2 id="Specifications">仕様書</h2>

<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">仕様書</th>
      <th scope="col">状態</th>
      <th scope="col">備考</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{SpecName('DOM WHATWG', '#dom-document-documenturi','documentURI')}}</td>
      <td>{{Spec2('DOM WHATWG')}}</td>
      <td></td>
    </tr>
  </tbody>
</table>

<h2 id="Browser_compatibility">ブラウザーの互換性</h2>

<p>{{Compat("api.Document.documentURI")}}</p>

<h2 id="See_also">関連情報</h2>

<ul>
  <li>同じ値を返す {{domxref("document.URL")}} プロパティ</li>
</ul>