I need to separate the file path from the file name:
If the path is www.example.com/hi/test/home.html
How would I get just www.example.com/hi/test/?
You can use substring and lastIndexOf:
a = www.example.com/hi/test/home.html
b = a.substr(0, a.lastIndexOf('/'))
// b = www.example.com/hi/test