how to get current directory in js code example
Example: javascript get current directory
var loc = window.location.pathname;
var dir = loc.substring(0, loc.lastIndexOf('/'));
var loc = window.location.pathname;
var dir = loc.substring(0, loc.lastIndexOf('/'));