jsp在js里获取项目名
2021-03-22 20:26
阅读:551
标签:ring UNC doc name str var cal dex localhost
function getRootPath() {
var curWwwPath = window.document.location.href;
var pathName = window.document.location.pathname;
var pos = curWwwPath.indexOf(pathName);
var localhostPath = curWwwPath.substring(0, pos);
//获取带"/"的项目名,如:/hotel
var projectName = pathName.substring(0, pathName.substr(1).indexOf(‘/‘) + 1);
return projectName;
}
jsp在js里获取项目名
标签:ring UNC doc name str var cal dex localhost
原文地址:https://www.cnblogs.com/liuyuanchen/p/12696940.html
评论
亲,登录后才可以留言!