how to copy the url front end javascript code example Example: javascript get url path window.location.pathname