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
Try this document.URL.substr(0,document.URL.lastIndexOf('/'))
document.URL.substr(0,document.URL.lastIndexOf('/'))
It will work for sure!