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