jsh获取项目的路径

来源:互联网 发布:教师网络研修的好处 编辑:程序博客网 时间:2024/06/05 08:27
 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);
0 0
原创粉丝点击