js 获取当前web应用的上下文路径实现方法

时间:2016-08-19    点击:131   

js 获取当前web应用的上下文路径实现方法

//js webcontext
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('/'));
  rootpath="/"+webroot; 

以上这篇js 获取当前web应用的上下文路径实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持本站。

jQuery中实现prop()函数控制多选框(全选,反选)
AngularJS入门教程之更多模板详解
详解Angular中$cacheFactory缓存的使用
JS获取当前页面名称的简单实例
JS获取当前使用的浏览器名字以及版本号实现方法
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved