//獲取路徑 var pathName=window.document.location.pathname; //截取,獲得項目名稱 var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);