JavaScript cara mencetak direktori kerja

var loc = window.location.pathname;
var dir = loc.substring(0, loc.lastIndexOf('/'));
Cautious Cicada