get the first subpath of a url after the host code example Example: javascript get url path window.location.pathname