纯Js文件获取项目路径
由于在js中,而不是模板引擎,无法用ctx
function getProjectName(){
如/contextPath/******/***
var pathName=window.document.location.pathname;
var pathIndex=pathName.substring(1).index("/");
if(pathIndex!=-1){
var projectName=pathName.substring(0,pathIndex);
}else{
var projectName=pathName;
}
return projectName
}