JS中获取类似JSP 中的basePath的方法

var local = window.location;
var contextPath = local.pathname.split("/")[1];
var basePath = local.protocol+"//"+local.host+"/"+contextPath;


posted @ 2013-05-30 10:28  梅尔加德斯  阅读(231)  评论(0编辑  收藏  举报