javascript get path out of link code example Example: javascript get url path window.location.pathname