HashChangeEvent: oldURL property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("HTML DOM")}}
The **oldURL** read-only property of the {{domxref("HashChangeEvent")}} interface returns the previous URL from which the window was navigated.
Value
A string.
Examples
js
window.addEventListener("hashchange", (event) => {
console.log(`Hash changed from ${event.oldURL}`);
});Specifications
{{Specifications}}
Browser compatibility
{{Compat}}