pathname property of the
URL interface is a string containing an initial
/ followed by the path of the URL, not including the query string or fragment (or the empty string if there is no path).
The path of the URL is a
/ delimited sequence of segments, which may each be one of
.. or a string with zero or more characters excluding
Some systems define the term slug to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL
this-that-other-outre-collection as its slug.
Some systems use the
= characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL
https://example.org/users;id=42/tasks;state=open?sort=modified, a system might extract and use the path segment parameters
state=open from the path segments
Note: This feature is available in Web Workers
const url = new URL('https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname?q=value'); console.log(url.pathname); // Logs "/en-US/docs/Web/API/URL/pathname"
|URL Standard |
BCD tables only load in the browser
URLinterface it belongs to.