var curWwwPath = window.document.location.href;
console.log(curWwwPath);
var pathName = window.document.location.pathname;
console.log(pathName);
var pos = curWwwPath.indexOf(pathName);
console.log(pos);
var localhostPaht = curWwwPath.substring(0, pos);
console.log(localhostPaht);
var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
console.log(projectName);
console.log(localhostPaht + projectName);
jsh获取项目的路径
最新推荐文章于 2024-05-05 01:51:32 发布