---
name: "up.history.location"
area: "API"
kind: "JavaScript property"
parent: "up.history module"
url: "https://unpoly.com/api/up.history.location"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.history module](https://unpoly.com/api/up.history.md)</nav>

# up.history.location

Returns a normalized URL for the current browser location.

The returned URL is an absolute pathname like `"/path"` without a hostname or port. It will include a `#hash` fragment and query string, if present.

> #### Note
>
> If the current [layer](https://unpoly.com/api/up.layer.md) does not have [visible history](https://unpoly.com/api/up.Layer.prototype.history.md), the browser's address bar will show the location of an ancestor layer. When [`up.history.config.enabled`](https://unpoly.com/api/up.history.config.md#config.enabled) [turns off](https://unpoly.com/learn/updating-history.md#disabling) the `'location'` aspect, the address bar keeps its URL while layers render other locations. To get the location of the current layer, use [`up.layer.location`](https://unpoly.com/api/up.layer.location.md).

---

## Value {#value}

### location {#location}

Type: string

