windowlocationpathname 去除最后一个
可以使用以下方法将最后一个路径部分去除:
var pathname = window.location.pathname;
var lastIndex = pathname.lastIndexOf("/");
var newPathname = pathname.substring(0, lastIndex);
console.log(newPathname);
这将打印出去除最后一个路径部分后的新路径。
原文地址: http://www.cveoy.top/t/topic/ixFS 著作权归作者所有。请勿转载和采集!