HTML中获取项目根路径

function getRootPath(){ var curPageUrl = window.document.location.href; var rootPath = curPageUrl.split("//")[0] + curPageUrl.split("//")[1].split("/")[0] + "/" + curPageUrl.split("//")[1].split("/")[1]; return rootPath; }

猜你喜欢

转载自www.cnblogs.com/lideqiang0909/p/11138094.html