Edit this page

up.history up:location:changed
DOM event

This event is emitted after the browser's address bar was updated with a new URL.

There may be several reasons why the browser location was changed:

  • A fragment update changes history through navigation or rendering with { history: true }.
  • The user uses the back or forward buttons in their browser UI.
  • Programmatic calls to up.history.push().

When a layer has no visible history, following a link will not cause the browser's address bar to be updated. In this case no up:location:changed event will be emitted. However, a up:layer:location:changed will be emitted even if the address bar did not change.

The up:location:changed event is not emitted when the page is loaded initially. For this observe up:framework:booted.

Properties

event.location string

The URL for the history entry after the change.

event.reason string experimental

The action that caused this change in history state.

The value of this property is either 'push', 'pop' or 'replace'.