I\'m trying to add a \"back to dir\" button at the top of a web page, which would redirect the user to the same URL, but with no filename in it.
For example, clickin
console.log(new URL(document.URL));
you would get all object like this :
{
href:"https://yy.xx.id/index.php/5351/user/private/images%20%282%29.jpeg?forcedownload=1",
origin:"https://smi.kerjaindonesia.id",
protocol: "https:",
username: "",
password: "",
pathname: "index.php/5351/user/private/images%20%282%29.jpeg" ,
port: "" ,
protocol: "https:",
search: "?forcedownload=1"
}