function getRootPath() { var pathName = window.location.pathname.substring(1); var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/')); if (webName == '') { return window.location.protocol + '//' + window.location.host + '/'; } else { return window.location.protocol + '//' + window.location.host + '/' + webName + '/' ; } }
js get the project root path
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=324539945&siteId=291194637
Ranking