how to read directory using url path javascript code example Example: javascript get url path window.location.pathname