javascript separate path and search code example Example: javascript get url path window.location.pathname