Получите ток-ректорацию в Javascript
var location = window.location.pathname;
var directoryPath = location.substring(0, location.lastIndexOf("/")+1);
Borma
var location = window.location.pathname;
var directoryPath = location.substring(0, location.lastIndexOf("/")+1);