06-27-2016 02:52 AM
var baseUrl = window.document.location.protocol + "//" + window.document.location.host + "/";
var shortenedUrl = window.document.location.href.replace(baseUrl, "");
baseUrl = baseUrl + shortenedUrl.substring(0, shortenedUrl.indexOf("/"));
shortenedUrl.substring(0, shortenedUrl.indexOf("/")); can not get the contextPath,and make the wrong append operate.