js获取上下文路径

    技术2022-05-20  42

    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()+'==========')


    最新回复(0)