kong0itey 发表于 2013-1-29 08:48:49

在javascript中获得网站根路径的方法

在javascript中获得网站根路径的方法
      function getRootPath() {            var pathName = window.location.pathname.substring(1);            var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));               return window.location.protocol + '//' + window.location.host + '/'+ webName;      }
页: [1]
查看完整版本: 在javascript中获得网站根路径的方法