js get path from url from string code example Example: javascript get url path window.location.pathname