Get-the-Current-Directory-Name-in-Javascript

var location = window.location.pathname;
var directoryPath = location.substring(0, location.lastIndexOf("/")+1);
Borma