blob: ebba5fad22af14363f4eab3b27b0263c6c5c0d40 (
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
70
71
72
73
74
75
76
|
---
title: Document.URL
slug: Web/API/Document/URL
tags:
- API
- Document
- Property
translation_of: Web/API/Document/URL
---
<div>{{APIRef("DOM")}}</div>
<p>Возвращает строку URL документа HTML.</p>
<h2 id="Syntax" name="Syntax">Синтаксис</h2>
<pre class="syntaxbox"><em>string</em> = document.URL
</pre>
<p> </p>
<h2 id="Пример">Пример</h2>
<h3 id="JavaScript">JavaScript</h3>
<pre><code>document.getElementById("url").textContent = document.URL;</code></pre>
<h3 id="HTML">HTML</h3>
<pre><code><p id="urlText">
URL:<br/>
<span id="url">URL goes here</span>
</p></code></pre>
<h3 id="Результат">Результат</h3>
<p>{{EmbedLiveSample("Example", "100%", 100)}}</p>
<h2 id="Спецификации">Спецификации</h2>
<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-url", "Document.URL")}}</td>
<td>{{Spec2("DOM WHATWG")}}</td>
<td>Defines that the property is a {{domxref("USVString")}} instead of a {{domxref("DOMString")}}.</td>
</tr>
<tr>
<td>{{SpecName("DOM1", "level-one-html.html#attribute-URL", "Document.URL")}}</td>
<td>{{Spec2("DOM1")}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="Браузерная_поддержка">Браузерная поддержка</h2>
<div class="hidden">
<p>The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>and send us a pull request.</p>
</div>
<p>{{Compat("api.Document.URL")}}</p>
<h2 id="Смотрите_также">Смотрите также</h2>
<ul>
<li>{{domxref("HTMLDocument")}}</li>
</ul>
<p> </p>
|