blob: 104fa38bfa978d9ae15d72cb71fdb81b0ab3599f (
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
|
---
title: HashChangeEvent.newURL
slug: Web/API/HashChangeEvent/newURL
tags:
- API
- HashChangeEvent
- Property
- Reference
- Web API
translation_of: Web/API/HashChangeEvent/newURL
---
<div>{{APIRef("HTML DOM")}}</div>
<div></div>
<p><code><strong>newURL</strong></code> 为 {{domxref("HashChangeEvent")}} 接口的只读属性,其值为窗口导航改变后的 URL。</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox notranslate">let <em>newEventUrl</em> = <em>event</em>.newURL;</pre>
<h3 id="返回值">返回值</h3>
<p>{{domxref("DOMString")}}.</p>
<h2 id="示例">示例</h2>
<pre class="brush: js notranslate">window.addEventListener('hashchange', function(event) {
console.log('Hash changed to ' + event.newURL);
});</pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">规范</th>
<th scope="col">状态</th>
<th scope="col">注释</th>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG', '#dom-hashchangeevent-newurl', 'HashChangeEvent: newURL')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td></td>
</tr>
</tbody>
</table>
|