js get current url without path code example Example: javascript get url path window.location.pathname