js获取web应用的根目录上下文
2017-05-09 15:26
274 查看
function getWebRootPath() {
var webroot=document.location.href;
webroot=webroot.substring(webroot.indexOf('//')+2,webroot.length);
webroot=webroot.substring(webroot.indexOf('/')+1,webroot.length);
webroot=webroot.substring(0,webroot.indexOf('/'));
var rootpath="/"+webroot;
return rootpath;
}
var webroot=document.location.href;
webroot=webroot.substring(webroot.indexOf('//')+2,webroot.length);
webroot=webroot.substring(webroot.indexOf('/')+1,webroot.length);
webroot=webroot.substring(0,webroot.indexOf('/'));
var rootpath="/"+webroot;
return rootpath;
}
相关文章推荐
- js 获取当前web应用的上下文路径实现方法
- java类获取web应用的根目录(转载)
- 获取web应用路径 // "/" 表示class 根目录
- js获取web项目根目录
- java类获取web应用的根目录
- js得到当前web应用的根目录
- 在一般类中通过XmlWebApplicationContext对象获取应用部署上下文Context
- web应用中获取spring上下文的方法
- .net下获取Web应用目录方法
- js获取网站根路径(站点及虚拟目录)
- 在普通web项目的servlet和filter中获取spring上下文
- 使用.net FtpWebRequest 实现FTP常用功能 上传 下载 获取文件列表 移动 切换目录 改名
- Web开发中用js里的document获取控件数组中某控件属性值
- 应用系统发布在Oracle Application Server 10g的上下文的根目录
- Servlet的Web应用---三种方法获取表单的各种属性(源码)
- c# webform js文件获取客户端控件,后台cs获取前台客户端控件的值,c#和js的交互
- 三种方法可以获取当前web程序目录物理路径
- 同一个WEB服务器中两个应用中的目录共享方法
- TOMCAT的目录结构;WEB应用的目录结构
- java web应用:两个根目录