Get-the-Current-Directory-name-in-Javascript

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