How to separate URLs with JavaScript?
I am making a "control panel" section for my website that allows me to upload files, edit pages, etc. It uses a combination of JavaScript and PHP on a Linux server. The main page is a page that lists all the folders and files in a directory. I've already made the code to edit, view, and delete files, as well as descend into folders. Now I need to finish the code to descend into folders. When I click on the "../" folder, it adds "../" to the path instead of going up a directory. How do I strip off the last part of the url, which looks like this: foo/bar/ using JavaScript?
|