JS中获取JSP 中的basePath的方法

转自原文:https://blog.csdn.net/fuli_mouren/article/details/8992729

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

猜你喜欢

转载自blog.csdn.net/small_emotion/article/details/85256866