js get the url before entering code example Example: javascript get url path window.location.pathname