首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

JS资料中获取contextPath的方法

2012-11-23 
JS文件中获取contextPath的方法function getContextPath() {??? var pathName document.location.pathna

JS文件中获取contextPath的方法

function getContextPath() {
??? var pathName = document.location.pathname;
??? var index = pathName.substr(1).indexOf("/");
??? var result = pathName.substr(0,index+1);
??? return result;
}

1 楼 tiandw 2011-09-23   如果一个服务器部署多个项目就不可以

热点排行