Name
HashChangeEvent — event object for hashchange events
Inherits from
Event
Synopsis
Browsers fire a hashchange event when the fragment identifier
(the portion of a URL beginning with the hash mark #) of the
document URL changes. This can happen because of a scripted change
to the hash property of the Location object, or because the user used the
browser’s Back or Forward buttons to navigate through the browser’s
history. In either case, a hashchange event is triggered. The
associated event object is a HashChangeEvent. See History Management for more on history management with
location.hash and the hashchange
event.
Properties
readonly stringnewURLThis property holds the new value of
location.href. Note that this is the complete URL, not just the hash portion of it.readonly stringoldURLThis property holds the old value of
location.href.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access