get only main path window.location code example Example: javascript get url path window.location.pathname