javascript get part of the url code example Example: javascript get url path window.location.pathname