js得到当前web应用的根目录
2008-09-28 17:18
260 查看
如:http://localhost:8080/news/template/index.jsp
得到的是:news
var basepath= document.location.pathname.substring(document.location.pathname.indexOf('/')+1) ;
basepath= basepath.substring(0,basepath.indexOf('/')) ;
得到的是:news
var basepath= document.location.pathname.substring(document.location.pathname.indexOf('/')+1) ;
basepath= basepath.substring(0,basepath.indexOf('/')) ;
相关文章推荐
- js 获取当前web应用的上下文路径实现方法
- VC得到当前目录与得到应用程序目录的一个应用
- js获取web应用的根目录上下文
- VC得到当前目录与得到应用程序目录的一个应用
- [Android]webview直接加载网页<允许JS,进度条,当前应用内跳转>
- 如何用js得到当前页面的url信息方法(JS获取当前网址信息)
- 使用Webpack提高Vue.js应用的方式汇总(四种)
- WebView使用总结(应用函数与JS函数互相调用)
- 如何用js得到当前页面的url信息方法(JS获取当前网址信息)
- Yeoman:Web 应用开发流程与工具—AngularJS—Bootstrap—js
- ASP得到当前文件所在目录
- 如何用js得到当前页面的url信息方法(JS获取当前网址信息)
- JAVA WEB项目目录结构以及web应用部署的根目录,编译路径和项目根目录的区别
- java web应用:两个根目录
- Js得到当前时间
- JS得到当前鼠标的坐标
- .net下获取Web应用目录方法
- Android:得到WebView当前页的html源码
- 当前流行的J2EE WEB应用架构分析
- Azure Web应用中设置静态虚拟目录的方法(比如部署Django需要用到)