function getContextPath() { var contextPath = document.location.pathname; alert(contextPath+"=====") var index =contextPath.substr(1).indexOf("/"); contextPath = contextPath.substr(0,index+1); delete index; return contextPath; } alert(getContextPath()+'==========')
js获取上下文路径
最新推荐文章于 2023-05-23 18:40:58 发布