Manage page URLs and navigation with the location object
The
location object provides information about the current URL and methods to navigate the browser.| Property/Method | Description |
|---|---|
href | Gets the full URL; assigning a value triggers a page redirect |
origin | Gets the domain part (including protocol and port) |
search | Gets the query string (the part after ?) |
hash | Gets the anchor/hash value (the part after #) |
reload() | Refreshes the current page; passing true forces a reload |