get the current directory name in javascript

Solutions on MaxInterview for get the current directory name in javascript by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "get the current directory name in javascript"
Kim
07 Feb 2020
1var location = window.location.pathname;
2var directoryPath = location.substring(0, location.lastIndexOf("/")+1);
3
similar questions