html 获取项目根路径

function getContextPath(){     
    var pathName = document.location.pathname;     //当前文件的绝度路径
    var index = pathName.substr(1).indexOf("/");     
    var result = pathName.substr(0,index+1);     
    return result; 
}

 

原文出处:

[1] kopess, html 获取项目根路径, https://blog.csdn.net/yeyingss/article/details/53638679

 

相关文章:

  • 2021-05-17
  • 2022-12-23
猜你喜欢
  • 2021-12-28
  • 2021-11-27
  • 2021-11-27
  • 2021-11-27
  • 2021-09-04
相关资源
相似解决方案