javascript get current url paths code example Example: javascript get url path window.location.pathname