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
This one-liner also works:
document.URL.split('/').slice(0, -1).join('/')