Edit this page

up.util up.util.parseURL()
JavaScript function

Parses the given URL into components such as hostname and path.

If the given URL is not fully qualified, it is assumed to be relative to the current page.


let parsed = up.util.parseURL('/path?foo=value')
parsed.pathname // => '/path'
parsed.search // => '/?foo=value'
parsed.hash // => ''

Return value

The parsed URL as an object with protocol, hostname, port, pathname, search and hash properties.

This website uses cookies to improve usability and analyze traffic.
I accept or learn more