extract url in a http request javascript code example Example: javascript get url path window.location.pathname