diff options
Diffstat (limited to 'files/zh-cn/web/api/hashchangeevent/oldurl/index.html')
-rw-r--r-- | files/zh-cn/web/api/hashchangeevent/oldurl/index.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/hashchangeevent/oldurl/index.html b/files/zh-cn/web/api/hashchangeevent/oldurl/index.html new file mode 100644 index 0000000000..f93dd11624 --- /dev/null +++ b/files/zh-cn/web/api/hashchangeevent/oldurl/index.html @@ -0,0 +1,41 @@ +--- +title: HashChangeEvent.oldURL +slug: Web/API/HashChangeEvent/oldURL +translation_of: Web/API/HashChangeEvent/oldURL +--- +<div>{{APIRef("HTML DOM")}}</div> + +<div></div> + +<p><code><strong>oldURL</strong></code> 为 {{domxref("HashChangeEvent")}} 接口的只读属性,其值为窗口导航改变前的 URL。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox notranslate">let <em>oldEventUrl</em> = <em>event</em>.oldURL;</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 from ' + event.oldURL); +});</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-oldurl', 'HashChangeEvent: oldURL')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td></td> + </tr> + </tbody> +</table> |