//JS文件中获取contextPath的方法 function getContextPath() { var contextPath = document.location.pathname; var index =contextPath.substr(1).indexOf("/"); contextPath = contextPath.substr(0,index+1); delete index; return contextPath; }
JS文件中获取contextPath的方法
- 郭良俊只狗
- 2