Firefox Tomorrow

web api instance property

HashChangeEvent: oldURL property

View on MDN ↗

The oldURL read-only property of the HashChangeEvent interface returns the previous URL from which the window was navigated.

Value

A string.

Examples

window.addEventListener("hashchange", (event) => {
  console.log(`Hash changed from ${event.oldURL}`);
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.