js中获得项目工程名路径

var path = location.pathname;
var webPath = path.substring(0, path.substr(1).indexOf('/') + 1);获得工程名
原文地址:https://www.cnblogs.com/doveshelly/p/8868744.html